-
Notifications
You must be signed in to change notification settings - Fork 177
118 lines (110 loc) · 3.57 KB
/
slh-dsa.yml
File metadata and controls
118 lines (110 loc) · 3.57 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
name: slh-dsa
on:
pull_request:
paths:
- ".github/workflows/slh-dsa.yml"
- "slh-dsa/**"
- "Cargo.*"
push:
branches: master
defaults:
run:
working-directory: slh-dsa
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings"
CARGO_TERM_COLOR: always
NEXTEST_NO_TESTS: warn
# Cancels CI jobs when new commits are pushed to a PR branch
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
no_std:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- thumbv7em-none-eabi
- wasm32-unknown-unknown
rust:
- 1.85.0 # MSRV
- stable
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- run: cargo build --target ${{ matrix.target }} --no-default-features
# because we're sharding tests, we'll compile them once first
# upload that as artifact, and then re-download those artifacts
# and run the tests.
# This is heavily insired by https://github.com/nextest-rs/reuse-build-partition-example/blob/main/.github/workflows/ci.yml
build-test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.85.0 # MSRV
- stable
test_config:
- --no-default-features
- --all-features
- default
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: taiki-e/install-action@nextest
- run: cargo check --all-features
- run: cargo build --benches --all-features
- name: Build and archive tests
run: |
PROFILE="${{ matrix.test_config }}"
if [ "$PROFILE" = "default" ]; then
PROFILE="--features default"
fi
cargo nextest archive --archive-file nextest-archive-${{ matrix.rust }}-${{ matrix.test_config }}.tar.zst $PROFILE
- name: Upload archive to workflow
uses: actions/upload-artifact@v7
with:
name: nextest-archive-${{ matrix.rust }}-${{ matrix.test_config }}
# NOTE: upload-artifact does not respect the working directory, we need to prefix it.
# https://github.com/actions/upload-artifact/issues/294
path: slh-dsa/nextest-archive-${{ matrix.rust }}-${{ matrix.test_config }}.tar.zst
if-no-files-found: error
compression-level: 0
retention-days: 1
run-test:
name: slh-dsa/run tests
needs: build-test
runs-on: ubuntu-latest
strategy:
matrix:
test-partition: [1, 2, 3, 4]
rust:
- 1.85.0 # MSRV
- stable
test_config:
- --no-default-features
- --all-features
- "default"
steps:
- uses: actions/checkout@v6
- run: mkdir -p ~/.cargo/bin
- uses: taiki-e/install-action@nextest
- name: Download test archive
uses: actions/download-artifact@v8
with:
name: nextest-archive-${{ matrix.rust }}-${{ matrix.test_config }}
path: slh-dsa
- name: Run tests (${{ matrix.rust }}) (${{ matrix.test_config }})
run: |
PROFILE="${{ matrix.test_config }}"
if [ "$PROFILE" = "default" ]; then
PROFILE="--features default"
fi
~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-archive-${{ matrix.rust }}-${{ matrix.test_config }}.tar.zst \
--partition count:${{ matrix.test-partition }}/4