Skip to content

Commit c57b26c

Browse files
authored
Merge pull request #356 from koron/improve-workflows
arrange workflows: build and release
2 parents e1c0895 + e78b834 commit c57b26c

File tree

13 files changed

+390
-317
lines changed

13 files changed

+390
-317
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Checkout QMK firmware'
2+
3+
inputs:
4+
version:
5+
default: '0.22.3'
6+
type: string
7+
required: false
8+
path:
9+
default: '__qmk__'
10+
type: string
11+
required: false
12+
13+
runs:
14+
using: 'composite'
15+
steps:
16+
17+
- name: Checkout qmk_firmware
18+
uses: actions/checkout@v4
19+
with:
20+
path: ${{ inputs.path }}
21+
repository: qmk/qmk_firmware
22+
submodules: recursive
23+
ref: ${{ inputs.version }}
24+
25+
- name: Setup QMK
26+
shell: bash
27+
run: qmk setup --home ${{ inputs.path }} --yes
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Relase archive
2+
3+
inputs:
4+
name:
5+
type: string
6+
required: true
7+
version:
8+
default: ${{ github.ref_name }}
9+
type: string
10+
required: false
11+
12+
runs:
13+
using: 'composite'
14+
steps:
15+
16+
- name: Download artifact
17+
uses: actions/download-artifact@v3
18+
with:
19+
name: ${{ inputs.name }}-firmwares
20+
21+
- name: Archive firmwares
22+
shell: bash
23+
run: |
24+
zip -9 ${{ inputs.name }}-${{ inputs.version }}.zip keyball_${{ inputs.name }}_*.hex README.md
25+
# Add README.md if available
26+
if [ -f ${{ inputs.name }}/doc/firmware_README.md ] ; then
27+
cp ${{ inputs.name }}/doc/firmware_README.md README.md
28+
zip -9 ${{ inputs.name }}-${{ inputs.version }}.zip README.md
29+
rm -f README.md
30+
fi

.github/actions/setup-qmk/action.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,40 @@ inputs:
99
default: '__qmk__'
1010
type: string
1111
required: false
12+
avrgcc_version:
13+
default: '8.3.0'
14+
type: string
15+
required: false
1216

1317
runs:
1418
using: 'composite'
1519
steps:
16-
- name: Checkout qmk_firmware
17-
uses: actions/checkout@v3
18-
with:
19-
path: ${{ inputs.path }}
20-
repository: qmk/qmk_firmware
21-
submodules: recursive
22-
ref: ${{ inputs.version }}
2320

2421
- name: Install git and pip
2522
shell: bash
26-
run: sudo apt-get install -y git python3-pip
23+
run: sudo apt-get install -y git python3-pip libfl2
2724

2825
- name: Install QMK CLI
2926
shell: bash
3027
run: python3 -m pip install --user qmk
3128

29+
- name: Checkout qmk_firmware
30+
uses: actions/checkout@v4
31+
with:
32+
path: ${{ inputs.path }}
33+
repository: qmk/qmk_firmware
34+
submodules: recursive
35+
ref: ${{ inputs.version }}
36+
3237
- name: Setup QMK
3338
shell: bash
3439
run: qmk setup --home ${{ inputs.path }} --yes
40+
41+
- name: Install newer gcc-avr
42+
shell: bash
43+
run: |
44+
# use https://github.com/ZakKemble/avr-gcc-build instead of default
45+
wget -q --show-progress --progress=bar:force https://github.com/ZakKemble/avr-gcc-build/releases/download/v${{ inputs.avrgcc_version }}-1/avr-gcc-${{ inputs.avrgcc_version }}-x64-linux.tar.bz2 -O /tmp/avrgcc.tar.bz2
46+
sudo tar xjf /tmp/avrgcc.tar.bz2 --strip-components=1 -C /usr/
47+
rm -f /tmp/avrgcc.tar.bz2
48+
avr-gcc --version

.github/workflows/build.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Build all firmwares
2+
3+
on:
4+
push:
5+
paths:
6+
- 'qmk_firmware/keyboards/keyball/**.c'
7+
- 'qmk_firmware/keyboards/keyball/**.h'
8+
- 'qmk_firmware/keyboards/keyball/**.json'
9+
- '.github/actions/setup-qmk/**.yml'
10+
- '.github/workflows/build*.yml'
11+
tags-ignore:
12+
- '*'
13+
branches:
14+
- '*'
15+
16+
pull_request:
17+
paths:
18+
- 'qmk_firmware/keyboards/keyball/**.c'
19+
- 'qmk_firmware/keyboards/keyball/**.h'
20+
- 'qmk_firmware/keyboards/keyball/**.json'
21+
- '.github/actions/setup-qmk/**.yml'
22+
- '.github/workflows/build*.yml'
23+
24+
workflow_call: {}
25+
26+
jobs:
27+
28+
build:
29+
30+
strategy:
31+
matrix:
32+
keyboard: [ keyball39, keyball44, keyball61, keyball46, one47 ]
33+
keymap: [ test, default, via ]
34+
include:
35+
- keyboard: keyball46
36+
keymap: test_Left
37+
- keyboard: keyball46
38+
keymap: test_Both
39+
- keyboard: keyball46
40+
keymap: via_Left
41+
- keyboard: keyball46
42+
keymap: via_Both
43+
44+
name: Build ${{ matrix.keyboard }} w/ ${{ matrix.keymap }}
45+
46+
runs-on: ubuntu-latest
47+
container:
48+
image: ghcr.io/qmk/qmk_cli:latest
49+
50+
steps:
51+
52+
- name: Checkout source
53+
uses: actions/checkout@v4
54+
55+
- name: Checkout qmk_firmware
56+
uses: ./.github/actions/checkout-qmk_firmware
57+
58+
- name: Install a link to own source
59+
run: ln -s $(pwd)/qmk_firmware/keyboards/keyball __qmk__/keyboards/keyball
60+
61+
- run: qmk compile -j 4 -kb keyball/${{ matrix.keyboard }} -km ${{ matrix.keymap }}
62+
63+
- name: Archive firmwares
64+
uses: actions/upload-artifact@v3
65+
with:
66+
name: ${{ matrix.keyboard }}-firmwares
67+
path: __qmk__/*.hex
68+
69+
check-size:
70+
name: Check size
71+
runs-on: ubuntu-latest
72+
needs:
73+
- build
74+
75+
steps:
76+
77+
- uses: actions/download-artifact@v3
78+
with: { name: keyball39-firmwares }
79+
80+
- uses: actions/download-artifact@v3
81+
with: { name: keyball44-firmwares }
82+
83+
- uses: actions/download-artifact@v3
84+
with: { name: keyball61-firmwares }
85+
86+
- uses: actions/download-artifact@v3
87+
with: { name: keyball46-firmwares }
88+
89+
- uses: actions/download-artifact@v3
90+
with: { name: one47-firmwares }
91+
92+
- name: List size of firmwares
93+
run: |
94+
for f in *.hex ; do
95+
cut -c 2,3 $f | awk '{s+=strtonum("0x" $1)}END{printf "%5d/28672 (%2d%%, %5d bytes free) ",s,s*100/28672,28672-s}'
96+
echo $f
97+
done

.github/workflows/keyball39.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/keyball44.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/keyball46.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)