-
Notifications
You must be signed in to change notification settings - Fork 220
392 lines (373 loc) · 14.4 KB
/
fast.yml
File metadata and controls
392 lines (373 loc) · 14.4 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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
name: Fast
on:
push:
branches: [ "main" ]
pull_request:
merge_group:
permissions:
contents: read
concurrency:
group: tests-fast-${{ github.head_ref || github.ref_name || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
UDEPS_VERSION: 0.1.57
NIGHTLY_VERSION: nightly-2025-11-15
PANDOC_VERSION: 3.8.2.1
jobs:
Lint:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
include:
- os: ubuntu-latest
flags: "--features commonware-runtime/iouring-storage"
- os: ubuntu-latest
flags: "--features commonware-runtime/iouring-network"
- os: ubuntu-latest
flags: ""
- os: windows-latest
flags: ""
- os: macos-latest
flags: ""
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Install nightly Rust toolchain
run: rustup toolchain install ${{ env.NIGHTLY_VERSION }} && rustup component add --toolchain ${{ env.NIGHTLY_VERSION }} rustfmt
- name: Run setup
uses: ./.github/actions/setup
with:
additional-cache-key: ${{ matrix.flags || 'default' }}
- name: Install just
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2.60.0
with:
tool: just@1.43.0
- name: Fmt
run: just check-fmt
- name: Lint
run: just clippy ${{ matrix.flags }}
- name: Check docs
run: just check-docs ${{ matrix.flags }}
- name: Test docs
run: just test-docs ${{ matrix.flags }}
Tests:
name: "Tests (os: ${{ matrix.os }}, flags: \"${{ matrix.flags }}\") (partition: ${{ matrix.partition }}/2)"
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
partition: [1, 2]
flags:
- "--features commonware-runtime/iouring-storage"
- "--features commonware-runtime/iouring-network"
- "--no-default-features"
- ""
exclude:
# Only run io_uring features on Ubuntu
- os: windows-latest
flags: "--features commonware-runtime/iouring-storage"
- os: macos-latest
flags: "--features commonware-runtime/iouring-storage"
- os: windows-latest
flags: "--features commonware-runtime/iouring-network"
- os: macos-latest
flags: "--features commonware-runtime/iouring-network"
# Only run --no-default-features on Ubuntu
- os: windows-latest
flags: "--no-default-features"
- os: macos-latest
flags: "--no-default-features"
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Clear disk space
uses: ./.github/actions/disk
- name: Run setup
uses: ./.github/actions/setup
with:
additional-cache-key: ${{ matrix.flags || 'default' }}-part-${{ matrix.partition }}
- name: Install just & nextest
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2.60.0
with:
tool: just@1.43.0,cargo-nextest@0.9.129
- name: Run tests
run: just test ${{ matrix.flags }} --partition hash:${{matrix.partition}}/2 --verbose
Tests-Subset:
name: "Tests-Subset (os: ${{ matrix.os }}, package: ${{ matrix.package }}, flags: \"${{ matrix.flags }}\")"
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
include:
- os: ubuntu-latest
package: commonware-runtime
flags: "--features commonware-runtime/external"
- os: windows-latest
package: commonware-runtime
flags: "--features commonware-runtime/external"
- os: macos-latest
package: commonware-runtime
flags: "--features commonware-runtime/external"
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Run setup
uses: ./.github/actions/setup
with:
additional-cache-key: ${{ matrix.flags || 'default' }}
- name: Install just & nextest
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2.60.0
with:
tool: just@1.43.0,cargo-nextest@0.9.129
- name: Run subset tests
run: just test ${{ matrix.flags }} -p ${{ matrix.package }} --verbose
- name: Run subset doc tests
run: just test-docs ${{ matrix.flags }} -p ${{ matrix.package }}
Stability:
name: "Stability (${{ matrix.level }})"
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
level: [BETA, GAMMA, DELTA, EPSILON]
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Clear disk space
uses: ./.github/actions/disk
- name: Run setup
uses: ./.github/actions/setup
with:
additional-cache-key: stability-${{ matrix.level }}
- name: Install just
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2.60.0
with:
tool: just@1.43.0
- name: Check stability (${{ matrix.level }})
run: just check-stability ${{ matrix.level }}
Unstable-Public:
name: "Unstable Public"
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Clear disk space
uses: ./.github/actions/disk
- name: Run setup
uses: ./.github/actions/setup
with:
additional-cache-key: unstable-public
- name: Install just
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2.60.0
with:
tool: just@1.43.0
- name: Install nightly Rust toolchain
run: rustup toolchain install ${{ env.NIGHTLY_VERSION }}
- name: Check for unmarked public items
run: just unstable-public
Tests-Gate:
name: "Fast-Tests"
runs-on: ubuntu-latest
needs: [Tests, Tests-Subset, Stability, Unstable-Public]
if: always()
steps:
- name: Check test results
run: |
if [ "${{ needs.Tests.result }}" != "success" ]; then
echo "Tests failed"
exit 1
fi
if [ "${{ needs.Tests-Subset.result }}" != "success" ]; then
echo "Tests-Subset failed"
exit 1
fi
if [ "${{ needs.Stability.result }}" != "success" ]; then
echo "Stability checks failed"
exit 1
fi
if [ "${{ needs.Unstable-Public.result }}" != "success" ]; then
echo "Unstable-Public check failed"
exit 1
fi
echo "All tests passed!"
Dependencies:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Install nightly Rust toolchain
run: rustup toolchain install ${{ env.NIGHTLY_VERSION }}
- name: Get Rust version
id: rust-version
run: echo "rust_version=$(rustc +${{ env.NIGHTLY_VERSION }} --version)" >> "$GITHUB_OUTPUT"
- name: Run setup
uses: ./.github/actions/setup
- name: Install just & cargo-udeps
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2.60.0
with:
tool: just@1.43.0,cargo-udeps@${{ env.UDEPS_VERSION }}
- name: Check for unused dependencies
run: just udeps
Lock:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Clear disk space
uses: ./.github/actions/disk
- name: Run setup
uses: ./.github/actions/setup
- name: Build entire workspace
run: cargo build --workspace --all-targets
- name: Check Cargo.lock unchanged
run: |
if ! git diff --exit-code Cargo.lock; then
echo "ERROR: Cargo.lock was modified during build!"
echo "This suggests that the Cargo.lock file in the repository is not up to date."
echo "Please run 'cargo build' locally and commit the updated Cargo.lock."
exit 1
fi
echo "✓ Cargo.lock remained unchanged after building everything"
Docs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Install pandoc
run: |
wget -q https://github.com/jgm/pandoc/releases/download/${{ env.PANDOC_VERSION }}/pandoc-${{ env.PANDOC_VERSION }}-1-amd64.deb
sudo dpkg -i pandoc-${{ env.PANDOC_VERSION }}-1-amd64.deb || sudo apt-get install -f -y
rm pandoc-${{ env.PANDOC_VERSION }}-1-amd64.deb
- name: Build docs
run: cd docs && make
- name: Check docs unchanged
run: |
if ! git diff --exit-code docs/; then
echo "ERROR: Generated docs assets (HTML or sitemap) were modified during build!"
echo "This suggests that the generated files in docs/ are not up to date."
echo "Please run 'make' in the docs directory locally and commit the updated files."
exit 1
fi
echo "✓ Generated docs assets remained unchanged after running make"
WASM:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Run setup
uses: ./.github/actions/setup
- name: Add WASM target
run: rustup target add wasm32-unknown-unknown
- name: Build cryptography
run: cargo rustc --target wasm32-unknown-unknown --release --manifest-path cryptography/Cargo.toml --crate-type cdylib && du -h "${CARGO_TARGET_DIR:-target}/wasm32-unknown-unknown/release/commonware_cryptography.wasm"
- name: Build macros
run: cargo build --target wasm32-unknown-unknown --release --manifest-path macros/Cargo.toml # can't check size because it is a proc-macro
- name: Build math
run: cargo rustc --target wasm32-unknown-unknown --release --manifest-path math/Cargo.toml --crate-type cdylib && du -h "${CARGO_TARGET_DIR:-target}/wasm32-unknown-unknown/release/commonware_math.wasm"
- name: Build utils
run: cargo rustc --target wasm32-unknown-unknown --release --manifest-path utils/Cargo.toml --crate-type cdylib && du -h "${CARGO_TARGET_DIR:-target}/wasm32-unknown-unknown/release/commonware_utils.wasm"
- name: Build runtime
run: cargo rustc --target wasm32-unknown-unknown --release --manifest-path runtime/Cargo.toml --crate-type cdylib && du -h "${CARGO_TARGET_DIR:-target}/wasm32-unknown-unknown/release/commonware_runtime.wasm"
- name: Build consensus
run: cargo rustc --target wasm32-unknown-unknown --release --manifest-path consensus/Cargo.toml --crate-type cdylib && du -h "${CARGO_TARGET_DIR:-target}/wasm32-unknown-unknown/release/commonware_consensus.wasm"
- name: Build storage
run: cargo rustc --target wasm32-unknown-unknown --release --manifest-path storage/Cargo.toml --crate-type cdylib && du -h "${CARGO_TARGET_DIR:-target}/wasm32-unknown-unknown/release/commonware_storage.wasm"
no_std:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Run setup
uses: ./.github/actions/setup
- name: Check no_std compatibility
run: ./.github/scripts/check_no_std.sh
lint-toml:
name: Lint Cargo.toml Files
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Install just
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2.60.0
with:
tool: just@1.43.0
- name: Install UV
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
- name: Check Cargo.toml formatting
run: just fix-toml-fmt && git diff --exit-code
publish-order:
name: Check Publish Order
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Run setup
uses: ./.github/actions/setup
- name: Check publish order
run: python3 .github/scripts/check_publish_order.py
zepter:
name: Feature Propagation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
with:
submodules: true
- name: Install zepter
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2.60.0
with:
tool: zepter@1.85.0
- name: Format features
run: zepter format features
- name: Lint feature propagation
run: zepter run check
build:
name: "Build (toolchain: ${{ matrix.toolchain }})"
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
toolchain:
- msrv
- stable
- nightly
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Clear disk space
uses: ./.github/actions/disk
- name: Determine toolchain version
id: toolchain
run: |
if [ "${{ matrix.toolchain }}" = "msrv" ]; then
echo "version=$(grep -m1 '^rust-version' Cargo.toml | sed 's/.*"\(.*\)"/\1/')" >> "$GITHUB_OUTPUT"
else
echo "version=${{ matrix.toolchain }}" >> "$GITHUB_OUTPUT"
fi
- name: Run setup
uses: ./.github/actions/setup
with:
additional-cache-key: toolchain-${{ matrix.toolchain }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561
with:
toolchain: ${{ steps.toolchain.outputs.version }}
- name: Install just & cargo-hack
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2.60.0
with:
tool: just@1.43.0,cargo-hack@0.6.43
- name: Print Rust version
run: rustc --version
- name: Check feature powerset
run: RUSTFLAGS="-D warnings" just hack check