-
Notifications
You must be signed in to change notification settings - Fork 78
595 lines (589 loc) · 25.9 KB
/
ci.yml
File metadata and controls
595 lines (589 loc) · 25.9 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
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
name: "CI"
on:
push:
branches:
- "main"
- "forks/*"
- release-*.*
pull_request:
branches:
- "main"
- "v*.*.*-rc"
- release-*.*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
CACHE_KEY_SUFFIX: 20260112
CARGO_UDEPS_KEY_SUFFIX: 20260112
jobs:
misc-check:
name: misc check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Run typos check
uses: crate-ci/typos@master
- name: Check if Grafana dashboards are minimized
run: |
cargo x json --check
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
cargo-manifest-check:
name: cargo manifest check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-cargo-manifest-check
- name: Install tools
if: steps.cache.outputs.cache-hit != 'true'
run: |
cargo install taplo-cli --locked
- name: Run taplo fmt check
run: |
taplo fmt --check
rust-machete:
name: rust machete check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Run cargo machete
uses: bnjbvr/cargo-machete@main
rust-udeps:
name: rust udeps test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ env.CARGO_UDEPS_KEY_SUFFIX }}-rust-udeps
- name: Install NASM for aws-lc-rs on Windows
if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1
- name: Install ninja-build tool for aws-lc-fips-sys on Windows
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-ninja@v5
- name: Install cargo-udeps
if: steps.cache.outputs.cache-hit != 'true'
run: |
cargo install cargo-udeps --locked
- name: Unused Dependencies Check
env:
RUSTFLAGS: "--cfg tokio_unstable -Awarnings"
run: |
cargo udeps --all-targets
rust-ffmt-check:
name: rust ffmt check
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-rust-ffmt-check
- name: Fastidious Format Check
run: |
cargo fmt --all --check -- --config-path rustfmt.nightly.toml
- name: Hint
if: ${{ failure() }}
run: |-
echo "The ffmt (Fastidious Format Check) test is not a necessary."
echo "It uses unstable features to achieve a better format."
echo "If you want to pass the test, please install the nightly toolchain with \`rustup install nightly\`."
echo "Then run \`make ffmt\`."
rust-test:
name: rust test with codecov
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
rust_toolchain: [stable, 1.86.0]
serde: ["", "--features serde"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
components: rustfmt, clippy, llvm-tools-preview
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-rust-test
- name: Install NASM for aws-lc-rs on Windows
if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1
- name: Install ninja-build tool for aws-lc-fips-sys on Windows
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-ninja@v5
- name: Run rust format check
run: |
cargo fmt --all -- --check
- name: Run rust clippy check (stable)
if: matrix.rust_toolchain == 'stable'
run: |
cargo clippy -p foyer
cargo clippy -p foyer --features "tracing"
cargo clippy --all-targets ${{ matrix.serde }} --features tokio-console -- -D warnings -A "clippy::large_enum_variant"
cargo clippy --all-targets ${{ matrix.serde }} --features deadlock -- -D warnings
cargo clippy --all-targets ${{ matrix.serde }} --features tracing -- -D warnings
cargo clippy --all-targets ${{ matrix.serde }} --features clap -- -D warnings
cargo clippy --all-targets ${{ matrix.serde }} -- -D warnings
- if: steps.cache.outputs.cache-hit != 'true'
uses: taiki-e/install-action@cargo-llvm-cov
- if: steps.cache.outputs.cache-hit != 'true'
uses: taiki-e/install-action@nextest
- name: Run rust test with coverage (igored tests)
env:
RUST_BACKTRACE: 1
CI: true
run: |
cargo llvm-cov --no-report nextest --run-ignored only --no-capture --workspace ${{ matrix.serde }} --features "strict_assertions"
- name: Run rust test with coverage
env:
RUST_BACKTRACE: 1
CI: true
run: |
cargo llvm-cov --no-report nextest --features "strict_assertions"
- name: Run examples with coverage
env:
RUST_BACKTRACE: 1
CI: true
run: |
cargo llvm-cov --no-report run ${{ matrix.serde }} --example memory
cargo llvm-cov --no-report run ${{ matrix.serde }} --example hybrid
cargo llvm-cov --no-report run ${{ matrix.serde }} --example hybrid_full
cargo llvm-cov --no-report run ${{ matrix.serde }} --example event_listener
cargo llvm-cov --no-report run ${{ matrix.serde }} --features "tracing,jaeger" --example tail_based_tracing
cargo llvm-cov --no-report run ${{ matrix.serde }} --features "tracing,ot" --example tail_based_tracing
cargo llvm-cov --no-report run ${{ matrix.serde }} --example equivalent
cargo llvm-cov --no-report run ${{ matrix.serde }} --example export_metrics_prometheus_hyper
cargo llvm-cov --no-report run ${{ matrix.serde }} --example serde
- name: Generate codecov report
run: |
cargo llvm-cov report --lcov --output-path lcov.info
- uses: codecov/codecov-action@v4
if: runner.os == 'Linux' && runner.arch == 'X64' && matrix.rust_toolchain == 'stable'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
verbose: true
foyer-bench-fuzzy-test:
name: foyer bench fuzzy test with codecov
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rust_toolchain: [stable, 1.86.0]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
components: rustfmt, clippy, llvm-tools-preview
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-foyer-bench-fuzzy-test
- if: steps.cache.outputs.cache-hit != 'true'
uses: taiki-e/install-action@cargo-llvm-cov
- if: steps.cache.outputs.cache-hit != 'true'
uses: taiki-e/install-action@nextest
- name: Build foyer-bench
env:
RUST_BACKTRACE: 1
CI: true
run: |
cargo llvm-cov --no-report run --package foyer-bench --bin foyer-bench --features "strict_assertions" -- -h
- name: Run foyer-bench with coverage (eviction, psync)
env:
RUST_BACKTRACE: 1
CI: true
run: |
rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
cargo llvm-cov --no-report run --package foyer-bench --bin foyer-bench --features "strict_assertions" -- --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov --mem 16MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 10MiB --entry-size-min 2KiB --entry-size-max 128KiB --time 60 --policy eviction --io-engine psync
- name: Run foyer-bench with coverage (insertion, psync)
env:
RUST_BACKTRACE: 1
CI: true
run: |
rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
cargo llvm-cov --no-report run --package foyer-bench --bin foyer-bench --features "strict_assertions" -- --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov --mem 16MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 10MiB --entry-size-min 2KiB --entry-size-max 128KiB --time 60 --policy insertion --io-engine psync
- name: Run foyer-bench with coverage (eviction, io_uring)
env:
RUST_BACKTRACE: 1
CI: true
run: |
rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
cargo llvm-cov --no-report run --package foyer-bench --bin foyer-bench --features "strict_assertions" -- --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov --mem 16MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 10MiB --entry-size-min 2KiB --entry-size-max 128KiB --time 60 --policy eviction --io-engine io_uring
- name: Run foyer-bench with coverage (insertion, io_uring)
env:
RUST_BACKTRACE: 1
CI: true
run: |
rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
cargo llvm-cov --no-report run --package foyer-bench --bin foyer-bench --features "strict_assertions" -- --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov --mem 16MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 10MiB --entry-size-min 2KiB --entry-size-max 128KiB --time 60 --policy insertion --io-engine io_uring
# - name: Run foyer-bench with coverage (large, eviction)
# env:
# RUST_BACKTRACE: 1
# CI: true
# run: |
# rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
# mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
# cargo llvm-cov --no-report run --package foyer-bench --bin foyer-bench --features "strict_assertions" -- --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov --engine large --mem 16MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 10MiB --entry-size-min 2KiB --entry-size-max 128KiB --time 60 --policy eviction
# - name: Run foyer-bench with coverage (large, insertion)
# env:
# RUST_BACKTRACE: 1
# CI: true
# run: |
# rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
# mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
# cargo llvm-cov --no-report run --package foyer-bench --bin foyer-bench --features "strict_assertions" -- --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov --engine large --mem 16MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 10MiB --entry-size-min 2KiB --entry-size-max 128KiB --time 60 --policy insertion
# - name: Run foyer-bench with coverage (small, eviction)
# env:
# RUST_BACKTRACE: 1
# CI: true
# run: |
# rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
# mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
# cargo llvm-cov --no-report run --package foyer-bench --bin foyer-bench --features "strict_assertions" -- --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov --engine small --mem 4MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 1MiB --entry-size-min 1KiB --entry-size-max 24KiB --time 60 --policy eviction
# - name: Run foyer-bench with coverage (small, insertion)
# env:
# RUST_BACKTRACE: 1
# CI: true
# run: |
# rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
# mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
# cargo llvm-cov --no-report run --package foyer-bench --bin foyer-bench --features "strict_assertions" -- --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov --engine small --mem 4MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 1MiB --entry-size-min 1KiB --entry-size-max 24KiB --time 60 --policy insertion
# - name: Run foyer-bench with coverage (mixed, eviction)
# env:
# RUST_BACKTRACE: 1
# CI: true
# run: |
# rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
# mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
# cargo llvm-cov --no-report run --package foyer-bench --bin foyer-bench --features "strict_assertions" -- --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov --engine mixed=0.1 --mem 16MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 10MiB --entry-size-min 1KiB --entry-size-max 128KiB --time 60 --policy eviction
# - name: Run foyer-bench with coverage (mixed, insertion)
# env:
# RUST_BACKTRACE: 1
# CI: true
# run: |
# rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
# mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
# cargo llvm-cov --no-report run --package foyer-bench --bin foyer-bench --features "strict_assertions" -- --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov --engine mixed=0.1 --mem 16MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 10MiB --entry-size-min 1KiB --entry-size-max 128KiB --time 60 --policy insertion
- name: Generate codecov report
run: |
cargo llvm-cov report --lcov --output-path lcov.info
- uses: codecov/codecov-action@v4
if: runner.os == 'Linux' && runner.arch == 'X64' && matrix.rust_toolchain == 'stable'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
verbose: true
rustdoc-test:
name: rust doc test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-rustdoc-test
- name: Install NASM for aws-lc-rs on Windows
if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1
- name: Install ninja-build tool for aws-lc-fips-sys on Windows
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-ninja@v5
- name: Run rustdoc test
run: |
cargo test --features "nightly" --doc
- name: Test docs build with docs.rs
env:
RUSTDOCFLAGS: --cfg docsrs -D warnings
run: |
cargo doc --features "nightly" --no-deps
- name: Upload docs.rs docs as artifacts
uses: actions/upload-artifact@v4
with:
name: foyer-docs-${{ github.sha }}-${{ runner.os }}-${{ runner.arch }}
path: target/doc
if-no-files-found: error
retention-days: 7
deadlock:
name: run with single worker thread and deadlock detection
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-deadlock
- name: Run tests with single worker thread and deadlock detection
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "--cfg tokio_unstable"
RUST_LOG: info
TOKIO_WORKER_THREADS: 1
CI: true
run: |-
cargo test --all --features deadlock -- --nocapture
- name: Build foyer-bench with single worker thread and deadlock detection
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "--cfg tokio_unstable"
RUST_LOG: info
TOKIO_WORKER_THREADS: 1
CI: true
run: |-
cargo build --all --features deadlock
- name: Run foyer-bench with single worker thread and deadlock detection (eviction, psync)
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "--cfg tokio_unstable"
RUST_LOG: info
TOKIO_WORKER_THREADS: 1
CI: true
run: |-
rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-storage/deadlock
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage/deadlock
timeout 2m ./target/debug/foyer-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/deadlock --mem 16MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 10MiB --entry-size-min 2KiB --entry-size-max 128KiB --time 60 --policy eviction --io-engine psync
- name: Run foyer-bench with single worker thread and deadlock detection (insertion, psync)
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "--cfg tokio_unstable"
RUST_LOG: info
TOKIO_WORKER_THREADS: 1
CI: true
run: |-
rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-storage/deadlock
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage/deadlock
timeout 2m ./target/debug/foyer-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/deadlock --mem 16MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 10MiB --entry-size-min 2KiB --entry-size-max 128KiB --time 60 --policy insertion --io-engine psync
- name: Run foyer-bench with single worker thread and deadlock detection (eviction, io_uring)
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "--cfg tokio_unstable"
RUST_LOG: info
TOKIO_WORKER_THREADS: 1
CI: true
run: |-
rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-storage/deadlock
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage/deadlock
timeout 2m ./target/debug/foyer-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/deadlock --mem 16MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 10MiB --entry-size-min 2KiB --entry-size-max 128KiB --time 60 --policy eviction --io-engine io_uring
- name: Run foyer-bench with single worker thread and deadlock detection (insertion, io_uring)
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "--cfg tokio_unstable"
RUST_LOG: info
TOKIO_WORKER_THREADS: 1
CI: true
run: |-
rm -rf $GITHUB_WORKSPACE/foyer-data/foyer-storage/deadlock
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage/deadlock
timeout 2m ./target/debug/foyer-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/deadlock --mem 16MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 10MiB --entry-size-min 2KiB --entry-size-max 128KiB --time 60 --policy insertion --io-engine io_uring
asan:
name: run with address saniziter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-asan
- name: Run Unit Tests With Address Sanitizer
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "-Zsanitizer=address --cfg tokio_unstable"
RUST_LOG: info
CI: true
run: |-
cargo test --lib --bins --tests --target x86_64-unknown-linux-gnu -- --nocapture
- name: Run foyer-bench With Address Sanitizer
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "-Zsanitizer=address --cfg tokio_unstable"
RUST_LOG: info
CI: true
run: |-
cargo build --all --target x86_64-unknown-linux-gnu
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/asan
timeout 2m ./target/x86_64-unknown-linux-gnu/debug/foyer-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/asan --mem 16MiB --disk 256MiB --block-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --disk-write-throughput 10MiB --entry-size-min 2KiB --entry-size-max 128KiB --time 60
- name: Prepare Artifacts on Failure
if: ${{ failure() }}
run: |-
find ./target/x86_64-unknown-linux-gnu/debug/ -type f -executable -name 'foyer*' -print0 | xargs -0 tar czvf artifacts.asan.tgz --transform 's#.*/##'
- name: Upload Artifacts on Failure
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: artifacts.asan.tgz
path: artifacts.asan.tgz
madsim:
name: check build with madsim
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt, clippy
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-madsim
- if: steps.cache.outputs.cache-hit != 'true'
uses: taiki-e/install-action@nextest
- name: Run rust check (madsim)
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "--cfg tokio_unstable --cfg madsim"
RUST_LOG: info
TOKIO_WORKER_THREADS: 1
CI: true
run: |-
cargo check -p foyer --no-default-features --features "runtime-madsim-tokio"
- name: Run nextest (madsim)
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "--cfg tokio_unstable --cfg madsim"
RUST_LOG: info
run: |-
cargo nextest run --workspace --exclude foyer-bench --exclude examples --no-default-features --features "runtime-madsim-tokio"