-
-
Notifications
You must be signed in to change notification settings - Fork 68
267 lines (254 loc) · 8.74 KB
/
Copy pathregression.yml
File metadata and controls
267 lines (254 loc) · 8.74 KB
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
name: Regression
on:
push:
branches:
- master
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
- os: ubuntu-24.04-arm
rust: stable
target: aarch64-unknown-linux-gnu
- os: macOS-latest
rust: stable
target: aarch64-apple-darwin
- os: windows-latest
rust: stable
target: x86_64-pc-windows-msvc
- os: windows-11-arm
rust: stable
target: aarch64-pc-windows-msvc
runs-on: ${{ matrix.os }}
env:
RUSTC_WRAPPER: sccache
CARGO_INCREMENTAL: "0"
SCCACHE_CACHE_SIZE: "3G"
SCCACHE_DIR: ${{ github.workspace }}/.sccache
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
# wasm32 std lets the wasm component transport tests build their
# guest fixture; without it they skip silently.
targets: ${{ matrix.target }}, wasm32-unknown-unknown
# rust-cache caches ~/.cargo and target/ (dependency compilation) so cargo
# skips deps; sccache (content-addressed) then serves the workspace crates,
# which rust-cache alone cannot reuse across runs (cargo's mtime fingerprints
# break after checkout). The key is distinct because building under sccache
# changes every crate's fingerprint. Master saves; PRs restore read-only.
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ matrix.target }}-sccache
save-if: ${{ github.ref == 'refs/heads/master' }}
- uses: mozilla-actions/sccache-action@v0.0.10
with:
# stats stay in the job log via the explicit step below; keep them off
# the run-summary annotations
disable_annotations: true
- uses: actions/cache/restore@v4
continue-on-error: true
with:
path: ${{ github.workspace }}/.sccache
key: sccache-${{ matrix.target }}-${{ github.sha }}
restore-keys: sccache-${{ matrix.target }}-
- name: Run tests
run: cargo test --locked --target ${{ matrix.target }}
- name: sccache stats
if: always()
run: sccache --show-stats
- uses: actions/cache/save@v4
if: github.ref == 'refs/heads/master'
continue-on-error: true
with:
path: ${{ github.workspace }}/.sccache
key: sccache-${{ matrix.target }}-${{ github.sha }}
gen_sv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
with:
shared-key: gen_sv
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Run gen_sv
run: make gen_sv
- name: Check gen_sv
run: git diff --exit-code
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run rustfmt
run: cargo fmt -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
shared-key: clippy
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings
# Build the release-verylup veryl binary once and share it via an artifact;
# std / heliodor / cocotb consume it instead of each rebuilding (less redundant
# compile + fewer heavy jobs competing for runners).
build-veryl:
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: sccache
CARGO_INCREMENTAL: "0"
SCCACHE_CACHE_SIZE: "3G"
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
# Same rust-cache + sccache split as the build job above (deps via
# rust-cache; workspace crates via sccache, under a distinct -sccache key).
- uses: Swatinem/rust-cache@v2
with:
shared-key: build-veryl-sccache
save-if: ${{ github.ref == 'refs/heads/master' }}
- uses: mozilla-actions/sccache-action@v0.0.10
with:
disable_annotations: true
- uses: actions/cache/restore@v4
continue-on-error: true
with:
path: ~/.cache/sccache
key: sccache-build-veryl-${{ github.sha }}
restore-keys: sccache-build-veryl-
- name: Build veryl
run: cargo build --profile release-verylup --bin veryl
- name: sccache stats
if: always()
run: sccache --show-stats
- uses: actions/cache/save@v4
if: github.ref == 'refs/heads/master'
continue-on-error: true
with:
path: ~/.cache/sccache
key: sccache-build-veryl-${{ github.sha }}
- uses: actions/upload-artifact@v4
with:
name: veryl-release-verylup
path: target/release-verylup/veryl
retention-days: 1
std:
needs: build-veryl
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v4
with:
name: veryl-release-verylup
path: target/release-verylup
- run: chmod +x target/release-verylup/veryl
- name: Setup verilator
uses: veryl-lang/setup-verilator@v2
- name: Format check
run: ../../../target/release-verylup/veryl fmt --check
working-directory: crates/std/veryl
- name: Build check
run: ../../../target/release-verylup/veryl check
working-directory: crates/std/veryl
- name: Test
run: ../../../target/release-verylup/veryl test --sim verilator
working-directory: crates/std/veryl
heliodor:
needs: build-veryl
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: actions/download-artifact@v4
with:
name: veryl-release-verylup
path: target/release-verylup
- run: chmod +x target/release-verylup/veryl
- name: Test
run: ../../target/release-verylup/veryl test
working-directory: testcases/heliodor
# The single-hart SoC Linux boot is #[ignore] (long); run it in its own job so
# it runs in parallel with the main heliodor tests instead of serializing after
# them. It runs on the built-in cc-backend simulator (not verilator).
heliodor-boot:
needs: build-veryl
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: actions/download-artifact@v4
with:
name: veryl-release-verylup
path: target/release-verylup
- run: chmod +x target/release-verylup/veryl
- name: Test Linux boot
run: ../../target/release-verylup/veryl test --ignored --test test_soc_linux_boot
working-directory: testcases/heliodor
cocotb:
needs: build-veryl
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v4
with:
name: veryl-release-verylup
path: target/release-verylup
- run: chmod +x target/release-verylup/veryl
- name: Setup verilator
uses: veryl-lang/setup-verilator@v2
- name: Test cocotb 1.9.2
run: |
pip install "cocotb==1.9.2"
target/release-verylup/veryl test --sim verilator testcases/veryl/67_cocotb.veryl
- name: Test cocotb 2.0.0
run: |
pip install "cocotb==2.0.0"
target/release-verylup/veryl test --sim verilator testcases/veryl/67_cocotb.veryl
wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
continue-on-error: true
with:
shared-key: "${{ runner.os }}-wasm"
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Build for wasm
run: cargo check --target wasm32-unknown-unknown -p veryl-emitter -p veryl-formatter -p veryl-simulator
highlightgen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: 'true'
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
continue-on-error: true
with:
shared-key: "${{ runner.os }}-highlightgen"
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Run highlightgen
run: cargo run --bin highlightgen -- check