@@ -167,40 +167,33 @@ jobs:
167
167
RUSTFLAGS : ${{ matrix.rustflags }}
168
168
169
169
cross-tests :
170
- name : " ${{ matrix.target }} (via cross)"
170
+ name : " ${{ matrix.target_feature }} on ${{ matrix. target }} (via cross)"
171
171
runs-on : ubuntu-latest
172
172
strategy :
173
173
fail-fast : false
174
- # TODO: Sadly, we cant configure target-feature in a meaningful way
175
- # because `cross` doesn't tell qemu to enable any non-default cpu
176
- # features, nor does it give us a way to do so.
177
- #
178
- # Ultimately, we'd like to do something like [rust-lang/stdarch][stdarch].
179
- # This is a lot more complex... but in practice it's likely that we can just
180
- # snarf the docker config from around [here][1000-dockerfiles].
181
- #
182
- # [stdarch]: https://github.com/rust-lang/stdarch/blob/a5db4eaf/.github/workflows/main.yml#L67
183
- # [1000-dockerfiles]: https://github.com/rust-lang/stdarch/tree/a5db4eaf/ci/docker
184
174
185
175
matrix :
186
176
target :
187
- - i586-unknown-linux-gnu
188
- # 32-bit arm has a few idiosyncracies like having subnormal flushing
189
- # to zero on by default. Ideally we'd set
190
177
- armv7-unknown-linux-gnueabihf
191
- - aarch64-unknown-linux-gnu
192
- # Note: The issue above means neither of these mips targets will use
193
- # MSA (mips simd) but MIPS uses a nonstandard binary representation
194
- # for NaNs which makes it worth testing on despite that.
178
+ - thumbv7neon-unknown-linux-gnueabihf # includes neon by default
179
+ - aarch64-unknown-linux-gnu # includes neon by default
180
+ - powerpc-unknown-linux-gnu
181
+ - powerpc64le-unknown-linux-gnu # includes altivec by default
182
+ - riscv64gc-unknown-linux-gnu
183
+ # MIPS uses a nonstandard binary representation for NaNs which makes it worth testing
184
+ # non-nightly since https://github.com/rust-lang/rust/pull/113274
195
185
# - mips-unknown-linux-gnu
196
186
# - mips64-unknown-linux-gnuabi64
197
- - riscv64gc-unknown-linux-gnu
198
- # TODO this test works, but it appears to time out
199
- # - powerpc-unknown-linux-gnu
200
- # TODO this test is broken, but it appears to be a problem with QEMU, not us.
201
- # - powerpc64le-unknown-linux-gnu
202
- # TODO enable this once a new version of cross is released
187
+ # Lots of errors in QEMU and no real hardware to test on. Not clear if it's QEMU or bad codegen.
203
188
# - powerpc64-unknown-linux-gnu
189
+ target_feature : [default]
190
+ include :
191
+ - { target: powerpc64le-unknown-linux-gnu, target_feature: "+vsx" }
192
+ # Fails due to QEMU floating point errors, probably handling subnormals incorrectly.
193
+ # This target is somewhat redundant, since ppc64le has altivec as well.
194
+ # - { target: powerpc-unknown-linux-gnu, target_feature: "+altivec" }
195
+ # We should test this, but cross currently can't run it
196
+ # - { target: riscv64gc-unknown-linux-gnu, target_feature: "+v,+zvl128b" }
204
197
205
198
steps :
206
199
- uses : actions/checkout@v2
@@ -217,19 +210,35 @@ jobs:
217
210
# being part of the tarball means we can't just use the download/latest
218
211
# URL :(
219
212
run : |
220
- CROSS_URL=https://github.com/rust-embedded /cross/releases/download/v0.2.1 /cross-v0.2.1 -x86_64-unknown-linux-gnu.tar.gz
213
+ CROSS_URL=https://github.com/cross-rs /cross/releases/download/v0.2.5 /cross-x86_64-unknown-linux-gnu.tar.gz
221
214
mkdir -p "$HOME/.bin"
222
215
curl -sfSL --retry-delay 10 --retry 5 "${CROSS_URL}" | tar zxf - -C "$HOME/.bin"
223
216
echo "$HOME/.bin" >> $GITHUB_PATH
224
217
218
+ - name : Configure Emulated CPUs
219
+ run : |
220
+ echo "CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_RUNNER=qemu-ppc -cpu e600" >> $GITHUB_ENV
221
+ # echo "CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_RUNNER=qemu-riscv64 -cpu rv64,zba=true,zbb=true,v=true,vlen=256,vext_spec=v1.0" >> $GITHUB_ENV
222
+
223
+ - name : Configure RUSTFLAGS
224
+ shell : bash
225
+ run : |
226
+ case "${{ matrix.target_feature }}" in
227
+ default)
228
+ echo "RUSTFLAGS=" >> $GITHUB_ENV;;
229
+ *)
230
+ echo "RUSTFLAGS=-Ctarget-feature=${{ matrix.target_feature }}" >> $GITHUB_ENV
231
+ ;;
232
+ esac
233
+
225
234
- name : Test (debug)
226
235
run : cross test --verbose --target=${{ matrix.target }}
227
236
228
237
- name : Test (release)
229
238
run : cross test --verbose --target=${{ matrix.target }} --release
230
239
231
240
features :
232
- name : " Check cargo features (${{ matrix.simd }} × ${{ matrix.features }})"
241
+ name : " Test cargo features (${{ matrix.simd }} × ${{ matrix.features }})"
233
242
runs-on : ubuntu-latest
234
243
strategy :
235
244
fail-fast : false
@@ -240,12 +249,8 @@ jobs:
240
249
features :
241
250
- " "
242
251
- " --features std"
243
- - " --features generic_const_exprs"
244
- - " --features std --features generic_const_exprs"
245
252
- " --features all_lane_counts"
246
- - " --features all_lane_counts --features std"
247
- - " --features all_lane_counts --features generic_const_exprs"
248
- - " --features all_lane_counts --features std --features generic_const_exprs"
253
+ - " --all-features"
249
254
250
255
steps :
251
256
- uses : actions/checkout@v2
@@ -257,9 +262,9 @@ jobs:
257
262
run : echo "CPU_FEATURE=$(lscpu | grep -o avx512[a-z]* | sed s/avx/+avx/ | tr '\n' ',' )" >> $GITHUB_ENV
258
263
- name : Check build
259
264
if : ${{ matrix.simd == '' }}
260
- run : RUSTFLAGS="-Dwarnings" cargo check --all-targets --no-default-features ${{ matrix.features }}
265
+ run : RUSTFLAGS="-Dwarnings" cargo test --all-targets --no-default-features ${{ matrix.features }}
261
266
- name : Check AVX
262
267
if : ${{ matrix.simd == 'avx512' && contains(env.CPU_FEATURE, 'avx512') }}
263
268
run : |
264
269
echo "Found AVX features: $CPU_FEATURE"
265
- RUSTFLAGS="-Dwarnings -Ctarget-feature=$CPU_FEATURE" cargo check --all-targets --no-default-features ${{ matrix.features }}
270
+ RUSTFLAGS="-Dwarnings -Ctarget-feature=$CPU_FEATURE" cargo test --all-targets --no-default-features ${{ matrix.features }}
0 commit comments