-
Notifications
You must be signed in to change notification settings - Fork 220
263 lines (251 loc) · 9.32 KB
/
slow.yml
File metadata and controls
263 lines (251 loc) · 9.32 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
name: Slow
on:
push:
branches: [ "main" ]
pull_request:
merge_group:
permissions:
contents: read
concurrency:
group: tests-slow-${{ github.head_ref || github.ref_name || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
FUZZ_VERSION: 0.12.0
NIGHTLY_VERSION: nightly-2025-11-15
jobs:
Tests:
name: "Tests (os: ${{ matrix.os }}, flags: \"${{ matrix.flags }}\") (partition: ${{ matrix.partition }}/8)"
runs-on: ${{ matrix.os }}
timeout-minutes: 180
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
partition: [1, 2, 3, 4, 5, 6, 7, 8]
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 slow tests
run: just test ${{ matrix.flags }} --partition hash:${{matrix.partition}}/8 --verbose --profile slow
Tests-Gate:
name: "Slow-Tests"
runs-on: ubuntu-latest
needs: Tests
if: always()
steps:
- name: Check test results
run: |
if [ "${{ needs.Tests.result }}" != "success" ]; then
echo "Tests failed or were cancelled"
exit 1
fi
echo "All tests passed successfully!"
Benchmarks:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- package: commonware-cryptography
test_flags: ""
lint_flags: ""
- package: commonware-storage
test_flags: "--features test-traits"
lint_flags: "--cfg full_bench"
- package: commonware-storage
test_flags: "--features commonware-runtime/iouring-storage,test-traits"
lint_flags: "--cfg full_bench"
- package: commonware-coding
test_flags: ""
lint_flags: ""
- package: commonware-math
test_flags: ""
lint_flags: ""
- package: commonware-utils
test_flags: ""
lint_flags: ""
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Install nightly Rust toolchain
run: rustup toolchain install ${{ env.NIGHTLY_VERSION }}
- name: Run setup
uses: ./.github/actions/setup
- name: Install just
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2.60.0
with:
tool: just@1.43.0
- name: Test benchmarks
run: just test-benches ${{ matrix.package }} '${{ matrix.test_flags }}' '${{ matrix.lint_flags }}'
Fuzz:
runs-on: ubuntu-latest
timeout-minutes: 180
strategy:
matrix:
fuzz_dir: [broadcast/fuzz, codec/fuzz, coding/fuzz, collector/fuzz, consensus/fuzz, cryptography/fuzz, math/fuzz, p2p/fuzz, runtime/fuzz, storage/fuzz, stream/fuzz, utils/fuzz]
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Clear disk space
uses: ./.github/actions/disk
- 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: Cache cargo-fuzz
id: cargo-fuzz-cache
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: ${{ env.CARGO_HOME || '~/.cargo' }}/bin/cargo-fuzz
key: ${{ runner.os }}-${{ env.FUZZ_VERSION }}-cargo-fuzz-${{ steps.rust-version.outputs.rust_version }}
- name: Install cargo-fuzz
if: steps.cargo-fuzz-cache.outputs.cache-hit != 'true'
run: cargo +${{ env.NIGHTLY_VERSION }} install cargo-fuzz --version ${{ env.FUZZ_VERSION }}
- name: Install just
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2.60.0
with:
tool: just@1.43.0
- name: Ensure corpus directory exists
run: mkdir -p ${{ matrix.fuzz_dir }}/corpus
- name: Compute fuzz corpus cache key prefix
id: fuzz-corpus-cache-key
run: |
sanitized_fuzz_dir="$(echo "${{ matrix.fuzz_dir }}" | tr '/' '-')"
echo "prefix=${{ runner.os }}-fuzz-corpus-${sanitized_fuzz_dir}" >> "$GITHUB_OUTPUT"
- name: Restore fuzz corpus
id: fuzz-corpus-restore
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: ${{ matrix.fuzz_dir }}/corpus
key: ${{ steps.fuzz-corpus-cache-key.outputs.prefix }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
${{ steps.fuzz-corpus-cache-key.outputs.prefix }}-
- name: Test all targets
run: just fuzz ${{ matrix.fuzz_dir }} 60
- name: Save fuzz corpus
if: success() && github.ref == 'refs/heads/main'
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: ${{ matrix.fuzz_dir }}/corpus
key: ${{ steps.fuzz-corpus-restore.outputs.cache-primary-key }}
Unsafe:
name: "Miri Tests (partition: ${{ matrix.partition }}/8)"
runs-on: ubuntu-latest
timeout-minutes: 120
strategy:
matrix:
partition: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Run setup
uses: ./.github/actions/setup
with:
additional-cache-key: part-${{ matrix.partition }}
- name: Install miri
run: |
rustup toolchain install ${{ env.NIGHTLY_VERSION }} --component miri
rustup override set ${{ env.NIGHTLY_VERSION }}
cargo miri setup
- 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 miri tests for storage::index
run: |
cd storage
just miri index::tests --partition hash:${{matrix.partition}}/8
- name: Run miri tests for runtime::iobuf
run: |
cd runtime
just miri iobuf:: --partition hash:${{matrix.partition}}/8
- name: Run miri tests for runtime::buffer::paged::append
run: |
cd runtime
just miri utils::buffer::paged::append::tests:: --partition hash:${{matrix.partition}}/8
Unsafe-Tests-Gate:
name: "Unsafe-Tests"
runs-on: ubuntu-latest
needs: Unsafe
if: always()
steps:
- name: Check test results
run: |
if [ "${{ needs.Unsafe.result }}" != "success" ]; then
echo "Tests failed or were cancelled"
exit 1
fi
echo "All tests passed successfully!"
conformance:
# Run conformance tests on multiple architectures to catch platform-specific
# encoding differences.
name: "Breaking Changes (${{ matrix.name }}) (partition: ${{ matrix.partition }}/8)"
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
matrix:
name: [x86_64, arm64]
partition: [1, 2, 3, 4, 5, 6, 7, 8]
include:
- name: x86_64
os: ubuntu-latest
- name: arm64
os: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Run setup
uses: ./.github/actions/setup
with:
additional-cache-key: ${{ matrix.name }}-part-${{ matrix.partition }}
- name: Install just
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2.60.0
with:
tool: just@1.43.0,cargo-nextest@0.9.129
- name: Run conformance tests
run: just test-conformance --partition hash:${{ matrix.partition }}/8 && git diff --exit-code
Conformance-Gate:
name: "Breaking Changes"
runs-on: ubuntu-latest
needs: conformance
if: always()
steps:
- name: Check conformance results
run: |
if [ "${{ needs.conformance.result }}" != "success" ]; then
echo "Conformance tests failed or were cancelled"
exit 1
fi
echo "All conformance tests passed successfully!"