Skip to content

Commit a81a989

Browse files
committed
cleanup travis and run.sh scripts
1 parent 53537b3 commit a81a989

File tree

3 files changed

+112
-78
lines changed

3 files changed

+112
-78
lines changed

.travis.yml

Lines changed: 87 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5,81 +5,113 @@ rust: nightly
55
matrix:
66
fast_finish: true
77
include:
8-
- env: TARGET=i586-unknown-linux-gnu
9-
- env: TARGET=i686-unknown-linux-gnu
10-
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
11-
- env: TARGET=x86_64-unknown-linux-gnu-emulated NO_ADD=1 STDSIMD_TEST_EVERYTHING=1
12-
- env: TARGET=x86_64-linux-android
13-
- env: TARGET=arm-unknown-linux-gnueabihf
14-
- env: TARGET=arm-linux-androideabi
15-
- env: TARGET=armv7-unknown-linux-gnueabihf
16-
- env: TARGET=aarch64-unknown-linux-gnu
17-
- env: TARGET=mips-unknown-linux-gnu NORUN=1
18-
- env: TARGET=mipsel-unknown-linux-gnu NORUN=1
19-
- env: TARGET=mips64-unknown-linux-gnuabi64 NORUN=1
20-
- env: TARGET=mips64el-unknown-linux-gnuabi64 NORUN=1
21-
- env: TARGET=aarch64-linux-android
22-
- env: TARGET=powerpc-unknown-linux-gnu
23-
- env: TARGET=powerpc64-unknown-linux-gnu
24-
- env: TARGET=powerpc64le-unknown-linux-gnu
25-
- env: TARGET=s390x-unknown-linux-gnu NORUN=1
26-
- os: osx
8+
- name: "i586-unknown-linux-gnu"
9+
env: TARGET=i586-unknown-linux-gnu
10+
- name: "i686-unknown-linux-gnu"
11+
env: TARGET=i686-unknown-linux-gnu
12+
- name: "x86_64-unknown-linux-gnu"
13+
env: TARGET=x86_64-unknown-linux-gnu
14+
install: true
15+
- name: "x86_64-unknown-linux-gnu-emulated (runs all assert_instr tests)"
16+
env: TARGET=x86_64-unknown-linux-gnu-emulated STDSIMD_TEST_EVERYTHING=1
17+
install: true
18+
- name: "x86_64-linux-android - no assert_instr"
19+
env: TARGET=x86_64-linux-android STDSIMD_DISABLE_ASSERT_INSTR=1
20+
- name: "arm-unknown-linux-gnueabihf"
21+
env: TARGET=arm-unknown-linux-gnueabihf
22+
- name: "arm-linux-androideabi - no assert_instr"
23+
env: TARGET=arm-linux-androideabi STDSIMD_DISABLE_ASSERT_INSTR=1
24+
- name: "armv7-unknown-linux-gnueabihf - NEON"
25+
env: TARGET=armv7-unknown-linux-gnueabihf RUSTFLAGS="-C target-feature=+neon"
26+
- name: "aarch64-unknown-linux-gnu"
27+
env: TARGET=aarch64-unknown-linux-gnu
28+
- name: "mips-unknown-linux-gnu - build-only"
29+
env: TARGET=mips-unknown-linux-gnu NORUN=1
30+
- name: "mipsel-unknown-linux-gnu - build-only"
31+
env: TARGET=mipsel-unknown-linux-gnu NORUN=1
32+
- name: "mips64-unknown-linux-gnuabi64 - build-only"
33+
env: TARGET=mips64-unknown-linux-gnuabi64 NORUN=1
34+
- name: "mips64el-unknown-linux-gnuabi64 - build-only"
35+
env: TARGET=mips64el-unknown-linux-gnuabi64 NORUN=1
36+
- name: "aarch64-linux-android - no assert_instr"
37+
env: TARGET=aarch64-linux-android STDSIMD_DISABLE_ASSERT_INSTR=1
38+
- name: "powerpc-unknown-linux-gnu - no assert_instr"
39+
env: TARGET=powerpc-unknown-linux-gnu STDSIMD_DISABLE_ASSERT_INSTR=1
40+
- name: "powerpc64-unknown-linux-gnu - no assert_instr, no simd_test"
41+
env: TARGET=powerpc64-unknown-linux-gnu STDSIMD_DISABLE_ASSERT_INSTR=1 STDSIMD_TEST_NORUN=1
42+
- name: "powerpc64le-unknown-linux-gnu - no assert_instr, no simd_test"
43+
env: TARGET=powerpc64le-unknown-linux-gnu STDSIMD_DISABLE_ASSERT_INSTR=1 STDSIMD_TEST_NORUN=1
44+
- name: "s390x-unknown-linux-gnu - build-only"
45+
env: TARGET=s390x-unknown-linux-gnu NORUN=1
46+
- name: "i686-apple-darwin"
2747
env: TARGET=i686-apple-darwin
48+
os: osx
49+
osx_image: xcode10
50+
script: ci/run.sh
51+
- name: "env: TARGET=x86_64-apple-darwin"
52+
env: TARGET=x86_64-apple-darwin
53+
os: osx
54+
osx_image: xcode10
55+
install: true
56+
script: ci/run.sh
57+
- name: "wasm32-unknown-unknown"
58+
env: TARGET=wasm32-unknown-unknown
59+
- name: "thumbv6m-none-eabi - build libcore only"
60+
env: TARGET=thumbv6m-none-eabi NORUN=1 NOSTD=1
61+
script: ci/run.sh
62+
- name: "thumbv7m-none-eabi - build libcore only"
63+
env: TARGET=thumbv7m-none-eabi NORUN=1 NOSTD=1
2864
script: ci/run.sh
29-
- os: osx
30-
env: TARGET=x86_64-apple-darwin NO_ADD=1
65+
- name: "thumbv7em-none-eabi - build libcore only"
66+
env: TARGET=thumbv7em-none-eabi NORUN=1 NOSTD=1
3167
script: ci/run.sh
32-
- env: TARGET=wasm32-unknown-unknown
33-
- env: TARGET=thumbv6m-none-eabi NOSTD=1
34-
- env: TARGET=thumbv7m-none-eabi NOSTD=1
35-
- env: TARGET=thumbv7em-none-eabi NOSTD=1
36-
- env: TARGET=thumbv7em-none-eabihf NOSTD=1
37-
- env: TARGET=x86_64-pc-windows-msvc NO_ADD=1
68+
- name: "thumbv7em-none-eabihf - build libcore only"
69+
env: TARGET=thumbv7em-none-eabihf NORUN=1 NOSTD=1
70+
script: ci/run.sh
71+
- name: "x86_64-pc-windows-msvc"
72+
env: TARGET=x86_64-pc-windows-msvc
3873
os: windows
3974
script: ci/run.sh
40-
- env: TARGET=x86_64-pc-windows-gnu STDSIMD_DISABLE_ASSERT_INSTR=1
75+
install: true
76+
- name: "x86_64-pc-windows-gnu - no assert_instr"
77+
# FIXME: https://github.com/rust-lang-nursery/stdsimd/issues/595
78+
env: TARGET=x86_64-pc-windows-gnu STDSIMD_DISABLE_ASSERT_INSTR=1
4179
os: windows
4280
script: ci/run.sh
43-
- env: TARGET=i686-pc-windows-msvc STDSIMD_DISABLE_ASSERT_INSTR=1
81+
- name: "i686-pc-windows-msvc - no assert_instr"
82+
# FIXME: https://github.com/rust-lang-nursery/stdsimd/issues/595
83+
env: TARGET=i686-pc-windows-msvc STDSIMD_DISABLE_ASSERT_INSTR=1
4484
os: windows
4585
script: ci/run.sh
46-
- env: TARGET=i686-pc-windows-gnu
86+
- name: "i686-pc-windows-gnu"
87+
env: TARGET=i686-pc-windows-gnu
4788
os: windows
4889
script: ci/run.sh
49-
- env: DOCUMENTATION
90+
- name: "Documentation"
5091
install: true
5192
script: ci/dox.sh
52-
- env: VERIFY_X86
93+
- name: "Automatic verification: x86 and x86_64"
5394
script: cargo test --manifest-path crates/stdsimd-verify/Cargo.toml
5495
install: true
55-
- env: RUSTFMT=On TARGET=x86_64-unknown-linux-gnu NO_ADD=1
56-
before_script:
57-
- rustup component add rustfmt-preview
58-
script:
59-
- cargo fmt --all -- --check
60-
- env: CLIPPY=On TARGET=x86_64-unknown-linux-gnu NO_ADD=1
96+
- name: "rustfmt"
97+
install: rustup component add rustfmt-preview
98+
script: cargo fmt --all -- --check
99+
- name: "clippy"
100+
install: true
61101
script: |
62-
cargo install clippy
63-
cargo clippy --all -- -D clippy-pedantic
102+
if rustup component add clippy-preview; then
103+
cargo clippy --all -- -D clippy::pedantic
104+
fi
105+
- name: "Shellcheck"
106+
install: true
107+
script: shellcheck ci/*.sh
64108
allow_failures:
65-
- env: CLIPPY=On TARGET=x86_64-unknown-linux-gnu NO_ADD=1
66-
- env: RUSTFMT=On TARGET=x86_64-unknown-linux-gnu NO_ADD=1
67109
- env: TARGET=i686-pc-windows-gnu
68110

69-
install:
70-
- if [ "$NO_ADD" == "" ]; then rustup target add $TARGET; fi
71-
72-
script:
111+
install: rustup target add $TARGET
112+
script:
73113
- cargo generate-lockfile
74-
- |
75-
if [ "$NORUN" == "1" ]; then
76-
cargo build --target=$TARGET -p coresimd -p stdsimd --manifest-path crates/stdsimd/Cargo.toml
77-
cargo build --release --target=$TARGET -p coresimd -p stdsimd --manifest-path crates/stdsimd/Cargo.toml
78-
elif [ "$NOSTD" == "1" ]; then
79-
cargo build --target=$TARGET -p coresimd --manifest-path crates/stdsimd/Cargo.toml
80-
else
81-
ci/run-docker.sh $TARGET $FEATURES
82-
fi
114+
- ci/run-docker.sh $TARGET $FEATURES
83115

84116
notifications:
85117
email:

ci/run-docker.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ run() {
1919
--env TARGET=$target \
2020
--env STDSIMD_TEST_EVERYTHING \
2121
--env STDSIMD_ASSERT_INSTR_IGNORE \
22+
--env STDSIMD_DISABLE_ASSERT_INSTR \
23+
--env NOSTD \
24+
--env NORUN \
25+
--env STDSIMD_TEST_NORUN \
2226
--volume `pwd`:/checkout:ro \
2327
--volume `pwd`/target:/checkout/target \
2428
--workdir /checkout \

ci/run.sh

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,7 @@ export RUST_TEST_THREADS=1
1212

1313
RUSTFLAGS="$RUSTFLAGS --cfg stdsimd_strict"
1414

15-
# FIXME: on armv7 neon intrinsics require the neon target-feature to be
16-
# unconditionally enabled.
17-
# FIXME: on powerpc (32-bit) and powerpc64 (big endian) disable
18-
# the instr tests.
1915
case ${TARGET} in
20-
armv7*)
21-
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+neon"
22-
;;
23-
powerpc-*)
24-
export STDSIMD_DISABLE_ASSERT_INSTR=1
25-
;;
26-
powerpc64-*)
27-
export STDSIMD_DISABLE_ASSERT_INSTR=1
28-
export STDSIMD_TEST_NORUN=1
29-
;;
30-
3116
# On 32-bit use a static relocation model which avoids some extra
3217
# instructions when dealing with static data, notably allowing some
3318
# instruction assertion checks to pass below the 20 instruction limit. If
@@ -39,11 +24,6 @@ case ${TARGET} in
3924
i686-* | i586-*)
4025
export RUSTFLAGS="${RUSTFLAGS} -C relocation-model=static -Z plt=yes"
4126
;;
42-
*android*)
43-
export STDSIMD_DISABLE_ASSERT_INSTR=1
44-
;;
45-
*)
46-
;;
4727
esac
4828

4929
echo "RUSTFLAGS=${RUSTFLAGS}"
@@ -53,8 +33,18 @@ echo "STDSIMD_DISABLE_ASSERT_INSTR=${STDSIMD_DISABLE_ASSERT_INSTR}"
5333
echo "STDSIMD_TEST_EVERYTHING=${STDSIMD_TEST_EVERYTHING}"
5434

5535
cargo_test() {
56-
cmd="cargo test --target=$TARGET $1"
57-
cmd="$cmd -p coresimd -p stdsimd"
36+
subcmd="test"
37+
if [ "$NORUN" = "1" ]
38+
then
39+
export subcmd="build"
40+
fi
41+
cmd="cargo ${subcmd} --target=$TARGET $1"
42+
if [ "$NOSTD" = "1" ]
43+
then
44+
cmd="$cmd -p coresimd"
45+
else
46+
cmd="$cmd -p coresimd -p stdsimd"
47+
fi
5848
cmd="$cmd -- $2"
5949
$cmd
6050
}
@@ -65,8 +55,16 @@ cargo_test "--release"
6555
# Test targets compiled with extra features.
6656
case ${TARGET} in
6757
x86*)
68-
RUSTFLAGS="${RUSTFLAGS} -C target-feature=+avx"
6958
export STDSIMD_DISABLE_ASSERT_INSTR=1
59+
case ${TARGET} in
60+
*apple*)
61+
# Travis Apple VMs do not support AVX2
62+
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+avx"
63+
;;
64+
*)
65+
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+avx2"
66+
;;
67+
esac
7068
cargo_test "--release"
7169
;;
7270
wasm32-unknown-unknown*)

0 commit comments

Comments
 (0)