-
Notifications
You must be signed in to change notification settings - Fork 29
130 lines (111 loc) · 3.58 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
name: Firmware Checks
on:
push:
branches:
- master
- 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
- run: cargo make --cwd b1display
- run: cargo make --cwd c1minimal
- 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
- 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 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 c1minimal bin
cargo make --cwd ledmatrix bin
- name: Upload ledmatrix files
uses: actions/upload-artifact@v3
with:
name: inputmodule_fw_bin
path: |
ledmatrix.bin
ledmatrix.uf2
ledmatrix_10k.uf2
ledmatrix_evt.uf2
- name: Upload b1display files
uses: actions/upload-artifact@v3
with:
name: inputmodule_fw_uf2
path: |
b1display.bin
b1display.uf2
- name: Upload c1minimal files
uses: actions/upload-artifact@v3
with:
name: inputmodule_fw_uf2
path: |
c1minimal.bin
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 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 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 fl16-inputmodules -- --check