-
Notifications
You must be signed in to change notification settings - Fork 136
245 lines (218 loc) · 6.33 KB
/
build.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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
name: Build
on:
push:
branches:
- "master"
tags:
- "*"
schedule:
- cron: "40 4 * * *" # every day at 4:40
pull_request:
permissions:
contents: read
jobs:
stable:
name: "Test MSRV and Stable Features"
strategy:
matrix:
rust:
- nightly
- 1.59
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Run cargo build for stable
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --features instructions
- name: Run cargo build for stable without instructions
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features
- name: Run cargo doc for stable
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-default-features --features instructions
- name: Run cargo doc for stable without instructions
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-default-features
- name: Run cargo test for stable
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features instructions
- name: Run cargo test for stable without instructions
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features
test:
name: "Test"
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
target: x86_64-unknown-linux-musl
- name: "Print Rust Version"
run: |
rustc -Vv
cargo -Vv
- name: "Run cargo build"
uses: actions-rs/cargo@v1
with:
command: build
- name: "Run cargo doc"
uses: actions-rs/cargo@v1
with:
command: doc
- name: "Run cargo build on musl"
uses: actions-rs/cargo@v1
with:
command: build
args: --target x86_64-unknown-linux-musl
if: runner.os == 'Linux'
- name: "Run cargo test"
uses: actions-rs/cargo@v1
with:
command: test
- name: "Run cargo test on musl"
uses: actions-rs/cargo@v1
with:
command: test
args: --target x86_64-unknown-linux-musl
if: runner.os == 'Linux'
- name: "Install Rustup Targets"
run: |
rustup target add i686-unknown-linux-gnu
rustup target add thumbv7em-none-eabihf
- name: "Build on non x86_64 platforms"
run: |
cargo build --target i686-unknown-linux-gnu --no-default-features --features nightly
cargo build --target thumbv7em-none-eabihf --no-default-features --features nightly
bootloader-test:
name: "Bootloader Integration Test"
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
timeout-minutes: 15
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
- name: Cache binaries
id: cache-bin
uses: actions/cache@v4
with:
path: binaries
key: ${{ runner.OS }}-binaries
- name: Add binaries/bin to PATH
run: echo "$GITHUB_WORKSPACE/binaries/bin" >> $GITHUB_PATH
shell: bash
- name: "Install Rustup Components"
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
components: rust-src, llvm-tools-preview
- name: "Install cargo-xbuild"
run: cargo install cargo-xbuild --debug --root binaries
- name: "Install bootimage"
run: cargo install bootimage --debug --root binaries
# install QEMU
- name: Install QEMU (Linux)
run: |
sudo apt update
sudo apt install qemu-system-x86
if: runner.os == 'Linux'
- name: Install QEMU (macOS)
run: brew install qemu
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
- name: Install QEMU (Windows)
run: |
choco install qemu --version 2021.5.5
echo "$Env:Programfiles\qemu" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
if: runner.os == 'Windows'
shell: pwsh
- name: "Print QEMU Version"
run: qemu-system-x86_64 --version
- name: "Run Test Framework"
run: cargo xtest
shell: bash
working-directory: "testing"
check_formatting:
name: "Check Formatting"
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: "Clippy"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
components: clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
semver-checks:
name: Semver Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
shared-key: "semver-checks"
cache-targets: false
- run: cargo install cargo-semver-checks --locked
- name: Check semver
run: cargo +stable semver-checks check-release
kani:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
shared-key: "kani"
cache-targets: false
- uses: model-checking/[email protected]