@@ -36,13 +36,25 @@ jobs:
36
36
target : ${{ matrix.target }}
37
37
profile : minimal
38
38
override : true
39
- - run : cargo check --features compact,ctr,force-soft
40
- - run : cargo build --release --target ${{ matrix.target }}
41
- - run : cargo build --release --target ${{ matrix.target }} --features compact
42
- - run : cargo build --release --target ${{ matrix.target }} --features ctr
43
- - run : cargo build --release --target ${{ matrix.target }} --features force-soft
44
- - run : cargo build --release --target ${{ matrix.target }} --features hazmat
45
- - run : cargo build --release --target ${{ matrix.target }} --features compact,ctr,force-soft
39
+ - run : cargo check
40
+ - run : |
41
+ cargo build --target ${{ matrix.target }}
42
+ cargo build --target ${{ matrix.target }} --features hazmat
43
+ - env :
44
+ RUSTFLAGS : " -Dwarnings --cfg aes_force_soft"
45
+ run : |
46
+ cargo build --target ${{ matrix.target }}
47
+ cargo build --target ${{ matrix.target }} --features hazmat
48
+ - env :
49
+ RUSTFLAGS : " -Dwarnings --cfg aes_compact"
50
+ run : |
51
+ cargo build --target ${{ matrix.target }}
52
+ cargo build --target ${{ matrix.target }} --features hazmat
53
+ - env :
54
+ RUSTFLAGS : " -Dwarnings --cfg aes_force_soft --cfg aes_compact"
55
+ run : |
56
+ cargo build --target ${{ matrix.target }}
57
+ cargo build --target ${{ matrix.target }} --features hazmat
46
58
47
59
# Tests for the AES-NI backend
48
60
aesni :
76
88
profile : minimal
77
89
override : true
78
90
- run : ${{ matrix.deps }}
79
- - run : cargo test --release --target ${{ matrix.target }}
80
- - run : cargo test --release --target ${{ matrix.target }} --features compact
81
- - run : cargo test --release --target ${{ matrix.target }} --features ctr
82
- - run : cargo test --release --target ${{ matrix.target }} --features force-soft
83
- - run : cargo test --release --target ${{ matrix.target }} --features hazmat
84
- - run : cargo test --release --target ${{ matrix.target }} --all-features
91
+ - run : cargo test --target ${{ matrix.target }}
92
+ - run : cargo test --target ${{ matrix.target }} --features hazmat
93
+ - run : cargo test --target ${{ matrix.target }} --all-features
85
94
86
95
# Tests for CPU feature autodetection with fallback to portable software implementation
87
96
autodetect :
@@ -111,29 +120,29 @@ jobs:
111
120
profile : minimal
112
121
override : true
113
122
- run : ${{ matrix.deps }}
114
- - run : cargo test --release --target ${{ matrix.target }}
115
- - run : cargo test --release --target ${{ matrix.target }} --features compact
116
- - run : cargo test --release --target ${{ matrix.target }} --features ctr
117
- - run : cargo test --release --target ${{ matrix.target }} --features hazmat
118
- - run : cargo test --release --target ${{ matrix.target }} --all-features
123
+ - run : cargo test --target ${{ matrix.target }}
124
+ - run : cargo test --target ${{ matrix.target }} --features hazmat
125
+ - run : cargo test --target ${{ matrix.target }} --all-features
119
126
120
- # Tests for the portable software backend (i.e. `force-soft `-only)
127
+ # Tests for the portable software backend (i.e. `aes_force_soft `-only)
121
128
soft :
122
129
runs-on : ubuntu-latest
130
+ env :
131
+ RUSTFLAGS : " -Dwarnings --cfg aes_force_soft"
123
132
strategy :
124
133
matrix :
125
134
include :
126
135
# 32-bit Linux
127
136
- target : i686-unknown-linux-gnu
128
- rust : 1.41 .0 # MSRV (temporarily lower than with CPU feature auto-detection)
137
+ rust : 1.49 .0 # MSRV
129
138
deps : sudo apt update && sudo apt install gcc-multilib
130
139
- target : i686-unknown-linux-gnu
131
140
rust : stable
132
141
deps : sudo apt update && sudo apt install gcc-multilib
133
142
134
143
# 64-bit Linux
135
144
- target : x86_64-unknown-linux-gnu
136
- rust : 1.41 .0 # MSRV (temporarily lower than with CPU feature auto-detection)
145
+ rust : 1.49 .0 # MSRV
137
146
- target : x86_64-unknown-linux-gnu
138
147
rust : stable
139
148
steps :
@@ -145,28 +154,33 @@ jobs:
145
154
profile : minimal
146
155
override : true
147
156
- run : ${{ matrix.deps }}
148
- - run : cargo test --release --target ${{ matrix.target }} --features force-soft
149
- - run : cargo test --release --target ${{ matrix.target }} --features force-soft,compact
150
- - run : cargo test --release --target ${{ matrix.target }} --features force-soft,ctr
151
- - run : cargo test --release --target ${{ matrix.target }} --features force-soft,compact,ctr
157
+ - run : cargo test --target ${{ matrix.target }}
158
+ - run : cargo test --target ${{ matrix.target }} --all-features
159
+
152
160
153
161
# Cross-compiled tests
154
162
cross :
155
163
strategy :
156
164
matrix :
165
+ # note that on 1.49-1.50 cargo returns an error when `--features` is
166
+ # used inside virtual manifest, so we test 1.51 here
157
167
include :
158
168
# ARM64
159
169
- target : aarch64-unknown-linux-gnu
160
- rust : 1.49 .0 # MSRV
170
+ rust : 1.51 .0 # MSRV
161
171
- target : aarch64-unknown-linux-gnu
162
172
rust : stable
163
173
164
174
# PPC32
165
175
- target : powerpc-unknown-linux-gnu
166
- rust : 1.49 .0 # MSRV
176
+ rust : 1.51 .0 # MSRV
167
177
- target : powerpc-unknown-linux-gnu
168
178
rust : stable
169
179
runs-on : ubuntu-latest
180
+ # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml
181
+ defaults :
182
+ run :
183
+ working-directory : .
170
184
steps :
171
185
- uses : actions/checkout@v1
172
186
- run : ${{ matrix.deps }}
@@ -176,22 +190,45 @@ jobs:
176
190
target : ${{ matrix.target }}
177
191
profile : minimal
178
192
override : true
179
- - run : cargo install cross
180
- - run : cross test --release --target ${{ matrix.target }}
181
- - run : cross test --release --target ${{ matrix.target }} --features compact
182
- - run : cross test --release --target ${{ matrix.target }} --features ctr
183
- - run : cross test --release --target ${{ matrix.target }} --features force-soft
184
- - run : cross test --release --target ${{ matrix.target }} --features hazmat
185
- - run : cross test --release --target ${{ matrix.target }} --features compact,ctr,force-soft,hazmat
193
+ - name : Install pre-compiled cross
194
+ run : |
195
+ export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url')
196
+ wget -O /tmp/binaries.tar.gz $URL
197
+ tar -C /tmp -xzf /tmp/binaries.tar.gz
198
+ mv /tmp/cross ~/.cargo/bin
199
+ - run : |
200
+ cross test --package aes --target ${{ matrix.target }}
201
+ cross test --package aes --target ${{ matrix.target }} --features hazmat
202
+ - env :
203
+ RUSTFLAGS : " -Dwarnings --cfg aes_force_soft"
204
+ run : |
205
+ cross test --package aes --target ${{ matrix.target }}
206
+ cross test --package aes --target ${{ matrix.target }} --features hazmat
207
+ - env :
208
+ RUSTFLAGS : " -Dwarnings --cfg aes_compact"
209
+ run : |
210
+ cross test --package aes --target ${{ matrix.target }}
211
+ cross test --package aes --target ${{ matrix.target }} --features hazmat
212
+ - env :
213
+ RUSTFLAGS : " -Dwarnings --cfg aes_force_soft --cfg aes_compact"
214
+ run : |
215
+ cross test --package aes --target ${{ matrix.target }}
216
+ cross test --package aes --target ${{ matrix.target }} --features hazmat
186
217
187
218
# ARMv8 cross-compiled tests for AES intrinsics (nightly-only)
188
219
armv8 :
220
+ env :
221
+ RUSTFLAGS : " -Dwarnings --cfg aes_armv8"
189
222
strategy :
190
223
matrix :
191
224
include :
192
225
- target : aarch64-unknown-linux-gnu
193
226
rust : nightly
194
227
runs-on : ubuntu-latest
228
+ # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml
229
+ defaults :
230
+ run :
231
+ working-directory : .
195
232
steps :
196
233
- uses : actions/checkout@v1
197
234
- run : ${{ matrix.deps }}
@@ -201,15 +238,19 @@ jobs:
201
238
target : ${{ matrix.target }}
202
239
profile : minimal
203
240
override : true
204
- - run : cargo install cross
205
- - run : cross test --release --target ${{ matrix.target }} --features armv8
206
- - run : cross test --release --target ${{ matrix.target }} --features armv8,compact
207
- - run : cross test --release --target ${{ matrix.target }} --features armv8,ctr
208
- - run : cross test --release --target ${{ matrix.target }} --features armv8,force-soft
209
- - run : cross test --release --target ${{ matrix.target }} --features armv8,hazmat
210
- - run : cross test --release --target ${{ matrix.target }} --all-features
241
+ - name : Install pre-compiled cross
242
+ run : |
243
+ export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url')
244
+ wget -O /tmp/binaries.tar.gz $URL
245
+ tar -C /tmp -xzf /tmp/binaries.tar.gz
246
+ mv /tmp/cross ~/.cargo/bin
247
+ - run : cross test --package aes --target ${{ matrix.target }}
248
+ - run : cross test --package aes --target ${{ matrix.target }} --features hazmat
249
+ - run : cross test --package aes --target ${{ matrix.target }} --all-features
211
250
212
251
clippy :
252
+ env :
253
+ RUSTFLAGS : " -Dwarnings --cfg aes_compact"
213
254
runs-on : ubuntu-latest
214
255
steps :
215
256
- uses : actions/checkout@v1
@@ -219,4 +260,4 @@ jobs:
219
260
components : clippy
220
261
override : true
221
262
profile : minimal
222
- - run : cargo clippy --features compact,ctr, hazmat -- -D warnings
263
+ - run : cargo clippy --features hazmat -- -D warnings
0 commit comments