-
Notifications
You must be signed in to change notification settings - Fork 11
257 lines (203 loc) · 6.57 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
name: Check build
on: [push, pull_request]
env:
CARGO_BUILD_TARGET: x86_64-unknown-linux-gnu
OPENSSL_VERSION: 3.2.0
jobs:
codespell:
name: Run codespell
runs-on: ubuntu-latest
steps:
- name: Run codespell
uses: codespell-project/actions-codespell@v2
run-tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rust-src
- name: Use MSRV-specific .cargo/config.toml
run: |
mv .cargo/config.toml.msrv .cargo/config.toml
- name: Add problem matchers
run: echo "::add-matcher::.github/rust.json"
- name: Run tests
run: |
cargo test --all-targets --all-features
build-docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rust-src
- name: Add problem matchers
run: echo "::add-matcher::.github/rust.json"
- name: Build docs
env:
RUSTDOCFLAGS: --cfg docsrs
run: |
cargo doc --no-deps --all-features
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rust-src,clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Add problem matchers
run: echo "::add-matcher::.github/rust.json"
- name: Run clippy
run: cargo clippy --all-features --all-targets
rustfmt:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
- name: Add problem matchers
run: echo "::add-matcher::.github/rust.json"
- name: Run cargo fmt
run: cargo fmt -- --check
min-vers:
name: Minimal crate versions
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rust-src
- name: Install cargo-hack
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-hack
locked: false
- name: Install cargo-minimal-versions
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-minimal-versions
locked: false
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Add problem matchers
run: echo "::add-matcher::.github/rust.json"
- name: Check minimal versions
run: cargo minimal-versions check
features:
name: Feature powerset (nightly)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rust-src
- name: Install cargo-hack
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-hack
locked: false
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Add problem matchers
run: echo "::add-matcher::.github/rust.json"
- name: Check powerset
run: |
cargo hack check \
--feature-powerset \
--no-dev-deps \
--exclude-features aws-lc-rs \
--group-features client,fastrand,sha1_smol \
--group-features server,sha1_smol
msrv:
name: Feature powerset (MSRV)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Use MSRV-specific .cargo/config.toml
run: |
mv .cargo/config.toml.msrv .cargo/config.toml
- name: Install GCC for aarch64-linux-gnu
run: |
sudo apt update -y
sudo apt install -y gcc-aarch64-linux-gnu
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Install cargo-hack
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-hack
locked: false
- name: Install 1.79.0 toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.79.0
targets: aarch64-unknown-linux-gnu
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Add problem matchers
run: echo "::add-matcher::.github/rust.json"
- name: Check powerset on x86_64
run: |
cargo hack check \
--feature-powerset \
--no-dev-deps \
--exclude-features aws-lc-rs,nightly \
--group-features client,fastrand,sha1_smol \
--group-features server,sha1_smol
- name: Install cached cross-compiled OpenSSL
id: cache-openssl
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/aarch64-linux-gnu
key: ${{ runner.os }}-openssl-${{ env.OPENSSL_VERSION }}
- name: Cross-compile and install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true'
env:
CROSS_COMPILE: aarch64-linux-gnu-
run: |
wget https://www.openssl.org/source/openssl-${{ env.OPENSSL_VERSION }}.tar.gz
tar xzf openssl-${{ env.OPENSSL_VERSION }}.tar.gz
cd openssl-${{ env.OPENSSL_VERSION }}
./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu- --prefix=${{ github.workspace }}/aarch64-linux-gnu
make -j$(nproc)
make install
- name: Check powerset on aarch64
env:
AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_DIR: ${{ github.workspace }}/aarch64-linux-gnu
run: |
cargo hack check \
--target aarch64-unknown-linux-gnu \
--feature-powerset \
--no-dev-deps \
--exclude-features aws-lc-rs,nightly \
--group-features client,fastrand,sha1_smol \
--group-features server,sha1_smol