-
Notifications
You must be signed in to change notification settings - Fork 0
179 lines (144 loc) · 5.11 KB
/
ci.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: CI
on: [push]
env:
CARGO_TERM_COLOR: always
jobs:
lint_libs:
name: Lint Libraries
runs-on: ubuntu-latest
strategy:
matrix:
package: [wire-protocols, env-config, bootloader-support, update-manager]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain and components
run: rustup component add rustfmt clippy
- name: Check
working-directory: libraries/${{ matrix.package }}
run: cargo check --all-features --target x86_64-unknown-linux-gnu
- name: Clippy
working-directory: libraries/${{ matrix.package }}
run: cargo clippy --all-features --target x86_64-unknown-linux-gnu -- -W clippy::all -D warnings
- name: Format
working-directory: libraries/${{ matrix.package }}
run: cargo fmt --all -- --check
- name: Doc Generation
working-directory: libraries/${{ matrix.package }}
run: cargo doc --workspace --bins --examples --all-features --no-deps --target x86_64-unknown-linux-gnu
test_libs:
name: Test Libraries
runs-on: ubuntu-latest
strategy:
matrix:
package: [wire-protocols, env-config, bootloader-support, update-manager]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain and components
run: rustup component add rustfmt clippy
- name: Test
working-directory: libraries/${{ matrix.package }}
run: cargo test --target x86_64-unknown-linux-gnu
lint_embedded:
name: Lint Embedded
runs-on: ubuntu-latest
strategy:
matrix:
package: [firmware, bootloader]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain and components
run: rustup component add rustfmt clippy
- name: Check
working-directory: ${{ matrix.package }}
run: cargo check --all-features
- name: Clippy
working-directory: ${{ matrix.package }}
run: cargo clippy --all-features -- -W clippy::all -D warnings
- name: Format
working-directory: ${{ matrix.package }}
run: cargo fmt --all -- --check
- name: Doc Generation
working-directory: ${{ matrix.package }}
run: cargo doc --workspace --bins --examples --all-features --no-deps
build_embedded:
name: Build Embedded
runs-on: ubuntu-latest
strategy:
matrix:
package: [firmware, bootloader]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain and components
run: rustup component add rustfmt clippy llvm-tools-preview
- name: Install binutils, flip-link
working-directory: ${{ matrix.package }}
run: cargo install cargo-binutils flip-link
- name: Build release binary
working-directory: ${{ matrix.package }}
run: cargo build --release
- name: Print firmware size
working-directory: ${{ matrix.package }}
run: |
cargo size --release
echo '## Firmware size' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cargo size --release >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
lint_host_tools:
name: Lint Host Tools
runs-on: ubuntu-latest
strategy:
matrix:
package: [agp-linker, air-gradient-cli]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain and components
run: rustup component add rustfmt clippy
- name: Check
working-directory: host_tools/${{ matrix.package }}
run: cargo check --all-features
- name: Clippy
working-directory: host_tools/${{ matrix.package }}
run: cargo clippy --all-features -- -W clippy::all -D warnings
- name: Format
working-directory: host_tools/${{ matrix.package }}
run: cargo fmt --all -- --check
- name: Doc Generation
working-directory: host_tools/${{ matrix.package }}
run: cargo doc --workspace --bins --examples --all-features --no-deps
build_host_tools:
name: Build Host Tools
runs-on: ubuntu-latest
strategy:
matrix:
package: [agp-linker, air-gradient-cli]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain and components
run: rustup component add rustfmt clippy
- name: Build debug binary
working-directory: host_tools/${{ matrix.package }}
run: cargo build --all-features
- name: Build release binary
working-directory: host_tools/${{ matrix.package }}
run: cargo build --release --all-features
test_host_tools:
name: Test Host Tools
runs-on: ubuntu-latest
strategy:
matrix:
package: [agp-linker, air-gradient-cli]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain and components
run: rustup component add rustfmt clippy
- name: Test
working-directory: host_tools/${{ matrix.package }}
run: cargo test