-
Notifications
You must be signed in to change notification settings - Fork 29
143 lines (124 loc) · 4.34 KB
/
firmware.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Firmware
on:
push:
branches:
- main
- dev-*
paths-ignore:
- '*.py'
- 'inputmodule-control/**'
pull_request:
branches:
- '*'
paths-ignore:
- '*.py'
- 'inputmodule-control/**'
env:
CARGO_TERM_COLOR: always
CARGO_NET_GIT_FETCH_WITH_CLI: true
jobs:
building:
name: Building
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
run: rustup show
- run: cargo install cargo-make
- run: cargo install flip-link
# Debug version
- run: cargo make --cwd b1display
- run: cargo make --cwd c1minimal
- run: cargo make --cwd ledmatrix
- run: cargo make --cwd qtpy
# Release version
- run: cargo make --cwd ledmatrix build-release
- run: cargo make --cwd ledmatrix build-release-10k
- run: cargo make --cwd ledmatrix build-release-evt
- run: cargo make --cwd b1display build-release
- run: cargo make --cwd c1minimal build-release
- run: cargo make --cwd qtpy build-release
- name: Convert to UF2 format
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev
cargo make --cwd b1display uf2
cargo make --cwd c1minimal uf2
cargo make --cwd qtpy uf2
cargo make --cwd ledmatrix build-release-10k-uf2
cargo make --cwd ledmatrix build-release-evt-uf2
cargo make --cwd ledmatrix uf2
- name: Convert to bin format
run: |
sudo apt-get update
sudo apt-get install -y llvm
cargo make --cwd b1display bin
cargo make --cwd qtpy bin
cargo make --cwd c1minimal bin
cargo make --cwd ledmatrix bin
- name: Upload ledmatrix files
uses: actions/upload-artifact@v3
with:
name: ledmatrix_fw_${{github.sha}}
path: |
# Main firmware
target/thumbv6m-none-eabi/release/ledmatrix.bin
target/thumbv6m-none-eabi/release/ledmatrix.uf2
# EVT 10k resistor
target/thumbv6m-none-eabi/release/ledmatrix_10k.uf2
# EVT (27k) resistor
target/thumbv6m-none-eabi/release/ledmatrix_evt.uf2
- name: Upload b1display files
uses: actions/upload-artifact@v3
with:
name: b1display_fw_${{github.sha}}
path: |
target/thumbv6m-none-eabi/release/b1display.bin
target/thumbv6m-none-eabi/release/b1display.uf2
- name: Upload c1minimal files
uses: actions/upload-artifact@v3
with:
name: c1minimal_fw_${{github.sha}}
path: |
target/thumbv6m-none-eabi/release/c1minimal.bin
target/thumbv6m-none-eabi/release/c1minimal.uf2
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
run: rustup show
- run: cargo install cargo-make
- run: |
sudo apt-get update
sudo apt-get install -y libudev-dev
cargo make clippy --cwd b1display
cargo make clippy --cwd qtpy
cargo make clippy --cwd c1minimal
cargo make clippy --cwd ledmatrix
# fl16-inputmodules/src/serialnum.rs
# is currently used by all firmwares to show their firmware version.
# But it shows the version of the fl16-inputmodules package.
# So that needs to be the same as the firmware version.
- name: Check versions of all packages are the same
run: |
cargo pkgid -p fl16-inputmodules | cut -d "#" -f2 >> versions.tmp
cargo pkgid -p b1display | cut -d "#" -f2 >> versions.tmp
cargo pkgid -p qtpy | cut -d "#" -f2 >> versions.tmp
cargo pkgid -p c1minimal | cut -d "#" -f2 >> versions.tmp
cargo pkgid -p ledmatrix | cut -d "#" -f2 >> versions.tmp
uniq -c versions.tmp | [ $(wc -l) -eq 1 ]
formatting:
name: Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
run: rustup show
- run: |
cargo fmt -p b1display -- --check
cargo fmt -p c1minimal -- --check
cargo fmt -p ledmatrix -- --check
cargo fmt -p qtpy -- --check
cargo fmt -p fl16-inputmodules -- --check