-
Notifications
You must be signed in to change notification settings - Fork 119
827 lines (705 loc) · 25.1 KB
/
ci.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
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
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
on:
push:
branches:
- main
pull_request:
branches:
- main
name: ci
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: 1
# Pin the nightly toolchain to prevent breakage.
# This should be occasionally updated.
RUST_NIGHTLY_TOOLCHAIN: nightly-2023-06-12
CDN: https://dnglbrstg7yg.cloudfront.net
# enable unstable features for testing
S2N_UNSTABLE_CRYPTO_OPT_TX: 100
S2N_UNSTABLE_CRYPTO_OPT_RX: 100
# By default depandabot only receives read permissions. Explicitly give it write
# permissions which is needed by the ouzi-dev/commit-status-updater task.
#
# Updating status is relatively safe (doesnt modify source code) and caution
# should we taken before adding more permissions.
permissions:
statuses: write
jobs:
env:
runs-on: ubuntu-latest
outputs:
rust-versions: ${{ steps.definitions.outputs.versions }}
msrv: ${{ steps.definitions.outputs.msrv }}
examples: ${{ steps.definitions.outputs.examples }}
crates: ${{ steps.definitions.outputs.crates }}
steps:
- uses: actions/checkout@v3
# examples is populated by
# find all child folders in the examples directory
# jq -R - raw content is passed in (not json, just strings)
# jq -s - slurp the content into an object
# jq '. += ' adds the s2n-quic-xdp crate to the list of crates we build
# Many of the xdp crates have much more complex build processes, so we
# don't try to build all of them.
# jq -c - output the object in (c)ompact mode on a single line, github
# will fail to parse multi line output
#
# the output is echo'd to make debugging easier
- name: Evaluate definitions
id: definitions
run: |
export MSRV=$(rustup show | awk 'NF' | awk 'END{print $2}')
echo "msrv=$MSRV"
echo "msrv=$MSRV" >> $GITHUB_OUTPUT
export RAW_VERSIONS="stable beta $RUST_NIGHTLY_TOOLCHAIN $MSRV"
export VERSIONS=$(echo $RAW_VERSIONS | jq -scR 'rtrimstr("\n")|split(" ")|.')
echo "versions=$VERSIONS"
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
export EXAMPLES=$(find examples/ -maxdepth 1 -mindepth 1 -type d | jq -R | jq -sc)
echo "examples=$EXAMPLES"
echo "examples=$EXAMPLES" >> $GITHUB_OUTPUT
export CRATES=$(find quic common -name *Cargo.toml | jq -R | jq -s | jq '. += ["tools/xdp/s2n-quic-xdp/Cargo.toml"]' | jq -c)
echo "crates=$CRATES"
echo "crates=$CRATES" >> $GITHUB_OUTPUT
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN }}
profile: minimal
override: true
components: rustfmt
- name: Run cargo fmt
uses: actions-rs/[email protected]
with:
command: fmt
args: --all -- --check
clippy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- toolchain: stable
# fail on stable warnings
args: "-D warnings"
- toolchain: beta
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
components: clippy
- uses: camshaft/rust-cache@v1
# TODO translate json reports to in-action warnings
- name: Run cargo clippy
uses: actions-rs/[email protected]
with:
command: clippy
# deriving Eq may break API compatibility so we disable it
# See https://github.com/rust-lang/rust-clippy/issues/9063
# manual_clamp will panic when min > max
# See https://github.com/rust-lang/rust-clippy/pull/10101
args: --all-features --all-targets -- -A clippy::derive_partial_eq_without_eq -A clippy::manual_clamp ${{ matrix.args }}
udeps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN }}
profile: minimal
override: true
- uses: camshaft/rust-cache@v1
- uses: camshaft/install@v1
with:
crate: cargo-udeps
- name: Run cargo udeps
run: cargo udeps --workspace --all-targets
env:
RUSTC_WRAPPER: ""
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: stable
profile: minimal
override: true
- uses: camshaft/rust-cache@v1
- name: Run cargo doc
uses: actions-rs/[email protected]
with:
command: doc
args: --all-features --no-deps --workspace --exclude s2n-quic-qns
- uses: aws-actions/[email protected]
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
- name: Upload to S3
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
id: s3
run: |
TARGET="${{ github.sha }}/doc"
aws s3 sync target/doc "s3://s2n-quic-ci-artifacts/$TARGET" --acl private --follow-symlinks
URL="$CDN/$TARGET/s2n_quic/index.html"
echo "URL=$URL" >> $GITHUB_OUTPUT
- uses: ouzi-dev/[email protected]
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
name: "doc / report"
status: "success"
url: "${{ steps.s3.outputs.URL }}"
test:
runs-on: ${{ matrix.os }}
needs: env
strategy:
fail-fast: false
matrix:
rust: ${{ fromJson(needs.env.outputs.rust-versions) }}
os: [ubuntu-latest, macOS-latest, windows-latest]
target: [native]
env: [default]
include:
- os: windows-latest
# s2n-tls doesn't currently build on windows
exclude: --workspace --exclude s2n-quic-tls
- rust: stable
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- rust: stable
os: ubuntu-latest
target: i686-unknown-linux-gnu
# test with different platform features
- rust: stable
os: ubuntu-latest
target: native
env: S2N_QUIC_PLATFORM_FEATURES_OVERRIDE=""
- rust: stable
os: ubuntu-latest
target: native
env: S2N_QUIC_PLATFORM_FEATURES_OVERRIDE="mtu_disc,pktinfo,tos,socket_msg"
steps:
- uses: actions/checkout@v3
with:
lfs: true
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: ${{ matrix.rust }}
override: true
target: ${{ matrix.target != 'native' && matrix.target || '' }}
- name: Install cross
if: ${{ matrix.target != 'native' }}
uses: camshaft/install@v1
with:
crate: cross
- uses: camshaft/rust-cache@v1
with:
key: ${{ matrix.target }}
- name: Restore fuzz corpus
shell: bash
run: |
find . -name 'corpus.tar.gz' -exec dirname {} ';' | xargs -L 1 bash -c 'cd "$0" && rm -rf corpus && tar xf corpus.tar.gz'
- name: Set environment variables
if: ${{ matrix.env != 'default' }}
run: echo ${{ matrix.env }} >> $GITHUB_ENV
# Build the tests before running to improve cross compilation speed
- name: Run cargo build
uses: actions-rs/[email protected]
with:
command: build
args: --tests ${{ matrix.exclude }} ${{ matrix.target != 'native' && format('--target {0}', matrix.target) || '' }}
use-cross: ${{ matrix.target != 'native' }}
- name: Run cargo test
uses: actions-rs/[email protected]
with:
command: test
args: ${{ matrix.exclude }} ${{ matrix.target != 'native' && format('--target {0}', matrix.target) || '' }}
use-cross: ${{ matrix.target != 'native' }}
miri:
# miri needs quite a bit of memory so use a larger instance
runs-on:
labels: s2n_ubuntu-20.04_8-core
strategy:
fail-fast: false
matrix:
crate: [quic/s2n-quic-core, quic/s2n-quic-platform]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN }}
override: true
components: miri, rust-src
- uses: camshaft/rust-cache@v1
with:
key: ${{ matrix.crate }}
- name: ${{ matrix.crate }}
# Disabling capture speeds up miri execution: https://github.com/rust-lang/miri/issues/1780#issuecomment-830664528
run: cd ${{ matrix.crate }} && cargo miri test -- --nocapture
env:
# needed to read corpus files from filesystem
MIRIFLAGS: -Zmiri-disable-isolation
no_std:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN }}
override: true
components: rust-src
- uses: camshaft/rust-cache@v1
- name: Run cargo build
run: ./scripts/test_no_std ${{ env.RUST_NIGHTLY_TOOLCHAIN }}
compliance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ./.github/actions/duvet
with:
report-script: ./scripts/compliance
report-path: ./target/compliance/report.html
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-s3-bucket-name: s2n-quic-ci-artifacts
aws-s3-region: us-west-1
cdn: $CDN
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Restore fuzz corpus
run: |
find . -name 'corpus.tar.gz' -exec dirname {} ';' | xargs -L 1 bash -c 'cd "$0" && rm -rf corpus && tar xf corpus.tar.gz'
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN }}
override: true
components: llvm-tools-preview
- uses: camshaft/rust-cache@v1
- name: Install cargo-llvm-cov
run: curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
- name: Run cargo test
uses: actions-rs/[email protected]
with:
command: llvm-cov
args: --html --no-fail-fast --workspace --exclude s2n-quic-qns --exclude s2n-quic-events --all-features
- uses: aws-actions/[email protected]
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
- name: Upload results
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
id: s3
run: |
TARGET="${{ github.sha }}/coverage"
aws s3 sync target/llvm-cov/html "s3://s2n-quic-ci-artifacts/$TARGET" --acl private --follow-symlinks
URL="$CDN/$TARGET/index.html"
echo "URL=$URL" >> $GITHUB_OUTPUT
- uses: ouzi-dev/[email protected]
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
name: "coverage / report"
status: "success"
url: "${{ steps.s3.outputs.URL }}"
# This CI step will directly build each crate in common/ and quic/ which is
# useful because it sidesteps the feature resolution that normally occurs in a
# workspace build. We make sure that the crates build with default features,
# otherwise release to crates.io will be blocked
crates:
needs: env
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
crate: ${{ fromJson(needs.env.outputs.crates) }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: ${{ needs.env.outputs.msrv }}
profile: minimal
override: true
- name: build
uses: actions-rs/[email protected]
with:
command: build
args: --manifest-path ${{ matrix.crate }}
examples:
needs: env
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example: ${{ fromJson(needs.env.outputs.examples) }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
# nightly features are used for formatting
- uses: actions-rs/[email protected]
id: nightly-toolchain
with:
toolchain: nightly
components: rustfmt
- uses: actions-rs/[email protected]
id: stable-toolchain
with:
toolchain: stable
override: true
- uses: camshaft/rust-cache@v1
with:
key: ${{ matrix.example }}
- name: format
working-directory: ${{ matrix.example }}
run: cargo +nightly fmt --all -- --check
- name: lint
working-directory: ${{ matrix.example }}
run: cargo clippy --all-features --all-targets -- -A clippy::manual_clamp -A clippy::uninlined_format_args -D warnings
# not all examples will build with the --manifest-path argument, since the
# manifest-path argument will pull configuration from the current directory
# instead of the directory with the Cargo.toml file
- name: build
working-directory: ${{ matrix.example }}
# TODO make sure the example actually runs as well
run: cargo build
recovery-simulations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: stable
profile: minimal
override: true
- uses: camshaft/rust-cache@v1
- name: Run simulations
run: |
./scripts/recovery-sim
- uses: aws-actions/[email protected]
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
- name: Upload to S3
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
id: s3
run: |
TARGET="${{ github.sha }}/recovery-simulations"
aws s3 sync target/recovery-sim "s3://s2n-quic-ci-artifacts/$TARGET" --acl private --follow-symlinks
URL="$CDN/$TARGET/index.html"
echo "URL=$URL" >> $GITHUB_OUTPUT
- uses: ouzi-dev/[email protected]
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
name: "recovery-simulations / report"
status: "success"
url: "${{ steps.s3.outputs.URL }}"
sims:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: stable
profile: minimal
override: true
- uses: camshaft/rust-cache@v1
- name: Run cargo build
uses: actions-rs/[email protected]
with:
command: build
args: --bin s2n-quic-sim --release
- name: Run simulations
run: |
./scripts/sim
- uses: aws-actions/[email protected]
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
- name: Upload to S3
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
id: s3
run: |
TARGET="${{ github.sha }}/sim"
aws s3 sync target/s2n-quic-sim "s3://s2n-quic-ci-artifacts/$TARGET" --acl private --follow-symlinks
URL="$CDN/$TARGET/index.html"
echo "URL=$URL" >> $GITHUB_OUTPUT
- uses: ouzi-dev/[email protected]
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
name: "sims / report"
status: "success"
url: "${{ steps.s3.outputs.URL }}"
copyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check
run: |
./scripts/copyright_check
# ensures the event codegen is up to date
events:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN }}
profile: minimal
override: true
components: rustfmt
- uses: camshaft/rust-cache@v1
- name: Run events codegen
run: |
cargo run --bin s2n-quic-events
- name: Check to make sure the generated events are up-to-date
run: |
# If this fails you need to run `cargo run --bin s2n-quic-events`
git diff --exit-code
# ensures there are no unused snapshots
snapshots:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: stable
profile: minimal
override: true
- name: Install cargo-insta
uses: camshaft/install@v1
with:
crate: cargo-insta
- uses: camshaft/rust-cache@v1
- name: Run cargo insta test
run: |
cargo insta test --delete-unreferenced-snapshots
- name: Check to make sure there are no unused snapshots
run: |
# If this fails, a test that was asserting a snapshot is no longer being executed.
git diff --exit-code
# generates a report of time spent in compilation
# https://doc.rust-lang.org/stable/cargo/reference/timings.html
timing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN }}
profile: minimal
override: true
- name: Run cargo build
run: |
cd examples/echo
cargo build --timings --release
- uses: aws-actions/[email protected]
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
- name: Upload to S3
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
id: s3
run: |
TARGET="${{ github.sha }}/timing/index.html"
aws s3 cp examples/echo/target/cargo-timings/cargo-timing.html "s3://s2n-quic-ci-artifacts/$TARGET" --acl private --follow-symlinks
URL="$CDN/$TARGET"
echo "URL=$URL" >> $GITHUB_OUTPUT
- uses: ouzi-dev/[email protected]
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
name: "timing / report"
status: "success"
url: "${{ steps.s3.outputs.URL }}"
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: stable
profile: minimal
override: true
- uses: camshaft/install@v1
with:
crate: typos-cli
bins: typos
- name: Run typos
run: |
./scripts/typos --format json | tee /tmp/typos.json | jq -rs '.[] | "::error file=\(.path),line=\(.line_num),col=\(.byte_offset)::\(.typo) should be \"" + (.corrections // [] | join("\" or \"") + "\"")'
cat /tmp/typos.json
! grep -q '[^[:space:]]' /tmp/typos.json
kani:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
crate: [quic/s2n-quic-core, quic/s2n-quic-platform, tools/xdp/s2n-quic-xdp]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Kani run
uses: model-checking/[email protected]
with:
working-directory: ${{ matrix.crate }}
args: --tests
dhat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: stable
profile: minimal
override: true
- uses: camshaft/rust-cache@v1
- name: Run cargo build
working-directory: tools/memory-report
run: cargo build --release
- name: Run server
working-directory: tools/memory-report
run: ./target/release/memory-report server &
- name: Run client
working-directory: tools/memory-report
run: ./target/release/memory-report client > report.tsv
- name: Prepare artifacts
working-directory: tools/memory-report
run: |
mkdir -p target/report
mv report.tsv target/report/
mv dhat-heap.json target/report/
- uses: aws-actions/[email protected]
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
- name: Upload to S3
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
id: s3
working-directory: tools/memory-report
run: |
TARGET="${{ github.sha }}/dhat"
aws s3 sync target/report "s3://s2n-quic-ci-artifacts/$TARGET" --acl private --follow-symlinks
URL="$CDN/dhat/dh_view.html?url=/$TARGET/dhat-heap.json"
echo "URL=$URL" >> $GITHUB_OUTPUT
- uses: ouzi-dev/[email protected]
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
name: "dhat / report"
status: "success"
url: "${{ steps.s3.outputs.URL }}"
loom:
runs-on: ubuntu-latest
strategy:
matrix:
crate: [quic/s2n-quic-core]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: stable
profile: minimal
override: true
- uses: camshaft/rust-cache@v1
with:
key: ${{ matrix.crate }}
- name: ${{ matrix.crate }}
# run the tests with release mode since some of the loom models can be expensive
run: cd ${{ matrix.crate }} && cargo test --release loom
env:
RUSTFLAGS: --cfg loom -Cdebug-assertions
xdp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions-rs/[email protected]
id: toolchain
with:
toolchain: 1.67.0
profile: minimal
override: true
components: clippy,rustfmt
- uses: camshaft/install@v1
with:
crate: bpf-linker
- uses: camshaft/rust-cache@v1
- name: Run clippy
working-directory: tools/xdp
run: cargo clippy
- name: Build ebpf
working-directory: tools/xdp
env:
RUST_LOG: trace
run: cargo xtask ci