-
Notifications
You must be signed in to change notification settings - Fork 31
210 lines (198 loc) · 7.32 KB
/
Copy pathtest-suite.yml
File metadata and controls
210 lines (198 loc) · 7.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
name: test-suite
on:
push:
branches:
- main
- "pr/*"
pull_request:
env:
# Deny warnings in CI
RUSTFLAGS: "-D warnings"
jobs:
cargo-fmt:
name: cargo-fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get latest version of stable Rust
run: rustup update stable
- name: Check formatting with cargo fmt
run: cargo fmt --all -- --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get latest version of stable Rust
run: rustup update stable
- name: Run clippy (all features)
run: cargo clippy --all-features -- -D warnings
- name: Run clippy (sha2 only)
run: cargo clippy --no-default-features --features "sha2,zero_hash_cache" -- -D warnings
- name: Run clippy (ring only)
run: cargo clippy --no-default-features --features "ring,zero_hash_cache" -- -D warnings
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
features:
- "sha2"
- "ring"
- "sha2,zero_hash_cache"
- "ring,zero_hash_cache"
- "sha2,ring,zero_hash_cache"
runs-on: ${{ matrix.os }}
name: test-${{ matrix.os }}-feat-${{ matrix.features }}
steps:
- uses: actions/checkout@v4
- name: Get latest version of stable Rust
run: rustup update stable
- name: Run tests
run: cargo test --release --no-default-features --features "${{ matrix.features }}"
test-wasm:
name: test-wasm32-${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: "sha2"
features: "sha2"
- name: "sha2,zero_hash_cache"
features: "sha2,zero_hash_cache"
# ring requires ring-wasm for WASM support
- name: "ring"
features: "ring-wasm"
- name: "ring,zero_hash_cache"
features: "ring-wasm,zero_hash_cache"
- name: "sha2,ring,zero_hash_cache"
features: "sha2,ring-wasm,zero_hash_cache"
steps:
- uses: actions/checkout@v4
- name: Get latest version of stable Rust
run: rustup update stable
- name: Install wasm32 target
run: rustup target add wasm32-unknown-unknown
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build for WASM
run: cargo build --target wasm32-unknown-unknown --no-default-features --features "${{ matrix.features }}"
- name: Run WASM tests (Node.js)
run: wasm-pack test --node --no-default-features --features "${{ matrix.features }}"
test-arm64:
name: test-aarch64-linux-${{ matrix.features }}
runs-on: ubuntu-latest
strategy:
matrix:
features:
- "sha2"
- "ring"
- "sha2,zero_hash_cache"
- "ring,zero_hash_cache"
- "sha2,ring,zero_hash_cache"
steps:
- uses: actions/checkout@v4
- name: Get latest version of stable Rust
run: rustup update stable
- name: Install cross
uses: taiki-e/install-action@cross
- name: Build for ARM64 with cross
run: cross build --target aarch64-unknown-linux-gnu --no-default-features --features "${{ matrix.features }}"
- name: Run ARM64 tests with cross (QEMU)
run: cross test --target aarch64-unknown-linux-gnu --no-default-features --features "${{ matrix.features }}"
test-arm64-macos:
name: test-aarch64-macos-${{ matrix.features }}
runs-on: macos-latest
strategy:
matrix:
features:
- "sha2"
- "ring"
- "sha2,zero_hash_cache"
- "ring,zero_hash_cache"
- "sha2,ring,zero_hash_cache"
steps:
- uses: actions/checkout@v4
- name: Get latest version of stable Rust
run: rustup update stable
- name: Run tests
run: cargo test --release --no-default-features --features "${{ matrix.features }}"
test-armv7:
name: test-armv7-linux-${{ matrix.features }}
runs-on: ubuntu-latest
strategy:
matrix:
features:
- "sha2"
- "ring"
- "sha2,zero_hash_cache"
- "ring,zero_hash_cache"
steps:
- uses: actions/checkout@v4
- name: Get latest version of stable Rust
run: rustup update stable
- name: Install cross
uses: taiki-e/install-action@cross
- name: Build for ARMv7 with cross
run: cross build --target armv7-unknown-linux-gnueabihf --no-default-features --features "${{ matrix.features }}"
- name: Run ARMv7 tests with cross (QEMU)
run: cross test --target armv7-unknown-linux-gnueabihf --no-default-features --features "${{ matrix.features }}"
test-riscv64:
name: test-riscv64-linux-${{ matrix.features }}
runs-on: ubuntu-latest
strategy:
matrix:
features:
- "sha2"
- "ring"
- "sha2,zero_hash_cache"
- "ring,zero_hash_cache"
- "sha2,ring,zero_hash_cache"
steps:
- uses: actions/checkout@v4
- name: Get latest version of stable Rust
run: rustup update stable
- name: Install cross
uses: taiki-e/install-action@cross
- name: Build for RISC-V 64 with cross
run: cross build --target riscv64gc-unknown-linux-gnu --no-default-features --features "${{ matrix.features }}"
- name: Run RISC-V 64 tests with cross (QEMU)
run: cross test --target riscv64gc-unknown-linux-gnu --no-default-features --features "${{ matrix.features }}"
# We use `--skip-clean` to aggregate the coverage from runs with different features.
coverage:
runs-on: ubuntu-latest
name: cargo-tarpaulin
steps:
- uses: actions/checkout@v4
- name: Get latest version of stable Rust
run: rustup update stable
- name: Install cargo-tarpaulin
uses: taiki-e/install-action@cargo-tarpaulin
- name: Check code coverage (sha2 only)
run: cargo-tarpaulin --workspace --out xml --no-default-features --features "sha2"
- name: Check code coverage (ring only)
run: cargo-tarpaulin --workspace --out xml --skip-clean --no-default-features --features "ring"
- name: Check code coverage (sha2 + zero_hash_cache)
run: cargo-tarpaulin --workspace --out xml --skip-clean --no-default-features --features "sha2,zero_hash_cache"
- name: Check code coverage (ring + zero_hash_cache)
run: cargo-tarpaulin --workspace --out xml --skip-clean --no-default-features --features "ring,zero_hash_cache"
- name: Check code coverage (all features)
run: cargo-tarpaulin --workspace --out xml --skip-clean --all-features
- name: Upload to codecov.io
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: false
msrv:
name: msrv-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install MSRV Rust (1.83.0)
run: rustup install 1.83.0 && rustup default 1.83.0
- name: Check with MSRV (sha2)
run: cargo check --no-default-features --features "sha2,zero_hash_cache"
- name: Check with MSRV (ring)
run: cargo check --no-default-features --features "ring,zero_hash_cache"
- name: Check with MSRV (all features)
run: cargo check --all-features