-
Notifications
You must be signed in to change notification settings - Fork 288
[ci] use cross for testing #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[build.env] | ||
passthrough = [ | ||
"RUST_BACKTRACE", | ||
"RUST_LOG", | ||
"TRAVIS" | ||
] | ||
|
||
[target.aarch64-unknown-linux-gnu] | ||
image = "stdsimd_aarch64-unknown-linux-gnu" | ||
passthrough = [ "OBJDUMP" ] | ||
|
||
[target.armv7-unknown-linux-gnueabihf] | ||
image = "stdsimd_armv7-unknown-linux-gnueabihf" | ||
passthrough = [ "OBJDUMP" ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to tweak these two images slightly to pass the correct |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
set -ex | ||
|
||
function ci_install() { | ||
echo "TARGET=${TARGET}" | ||
echo "RUSTFMT=${RUSTFMT}" | ||
echo "CLIPPY=${CLIPPY}" | ||
|
||
if [[ "${RUSTFMT}" == "On" ]]; then | ||
cargo install rustfmt-nightly; | ||
fi | ||
|
||
if [[ "${CLIPPY}" == "On" ]]; then | ||
cargo install clippy; | ||
fi | ||
|
||
if [[ "${TARGET}" == x86_64-unknown-linux-gnu-emulated ]]; then | ||
# Install Intel's Software Development Emulator | ||
INTEL_SDE=sde-external-8.12.0-2017-10-23-lin | ||
INTEL_SDE_URL=https://github.com/gnzlbg/intel_sde/raw/master/$INTEL_SDE.tar.bz2 | ||
wget $INTEL_SDE_URL | ||
tar -xjf $INTEL_SDE.tar.bz2 | ||
export TARGET=$(echo $TARGET | sed 's/-emulated//') | ||
export FEATURES="intel_sde" | ||
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="$(pwd)/$INTEL_SDE/sde64 -knm --" | ||
fi | ||
|
||
if [[ "${TARGET}" == arm-unknown-linux-gnueabihf ]] \ | ||
|| [[ "${TARGET}" == armv7-unknown-linux-gnueabihf ]] \ | ||
|| [[ "${TARGET}" == aarch64-unknown-linux-gnu ]]; then | ||
docker build -t stdsimd_${TARGET} ci/docker/${TARGET} | ||
fi | ||
|
||
if [[ "${TARGET}" == x86_64-unknown-linux-gnu ]] \ | ||
|| [[ "${TARGET}" == x86_64-apple-darwin ]] \ | ||
|| [[ "${TARGET}" == x86_64-pc-windows-msvc ]]; then | ||
export CARGO_DRIVER=cargo | ||
else | ||
export CARGO_DRIVER=cross | ||
fi | ||
|
||
if [[ "${CARGO_DRIVER}" == "cross" ]]; then | ||
rustup target add $TARGET | ||
cargo install cross | ||
fi | ||
|
||
export FEATURES="strict,${FEATURES}" | ||
export RUST_BACKTRACE=1 | ||
} | ||
|
||
cargo_test() { | ||
cmd="$CARGO_DRIVER test --all --target=$TARGET --features $FEATURES --verbose $1 -- --nocapture $2" | ||
$cmd | ||
} | ||
|
||
function ci_run() { | ||
echo "TARGET=${TARGET}" | ||
echo "RUSTFMT=${RUSTFMT}" | ||
echo "CLIPPY=${CLIPPY}" | ||
echo "CARGO_DRIVER=${CARGO_DRIVER}" | ||
echo "RUSTFLAGS=${RUSTFLAGS}" | ||
echo "RUST_BACKTRACE=${RUST_BACKTRACE}" | ||
echo "OBJDUMP=${OBJDUMP}" | ||
echo "FEATURES=${FEATURES}" | ||
|
||
cargo generate-lockfile | ||
|
||
# Tests are all super fast anyway, and they fault often enough on travis that | ||
# having only one thread increases debuggability to be worth it. | ||
export RUST_TEST_THREADS=1 | ||
|
||
if [[ "${RUSTFMT}" == "On" ]]; then | ||
cargo fmt --all -- --write-mode=diff | ||
elif [[ "${CLIPPY}" == "On" ]]; then | ||
cargo clippy --all -- -D clippy-pedantic | ||
else | ||
cargo_test | ||
cargo_test "--release" | ||
fi | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,6 @@ | ||
FROM ubuntu:17.10 | ||
FROM japaric/aarch64-unknown-linux-gnu:latest | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
gcc \ | ||
ca-certificates \ | ||
libc6-dev \ | ||
gcc-aarch64-linux-gnu \ | ||
libc6-dev-arm64-cross \ | ||
qemu-user \ | ||
make \ | ||
file | ||
|
||
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \ | ||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64 -L /usr/aarch64-linux-gnu" \ | ||
OBJDUMP=aarch64-linux-gnu-objdump | ||
ENV OBJDUMP=aarch64-linux-gnu-objdump |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,5 @@ | ||
FROM ubuntu:17.10 | ||
FROM japaric/armv7-unknown-linux-gnueabihf:latest | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
gcc \ | ||
ca-certificates \ | ||
libc6-dev \ | ||
gcc-arm-linux-gnueabihf \ | ||
libc6-dev-armhf-cross \ | ||
qemu-user \ | ||
make \ | ||
file | ||
ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \ | ||
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf" \ | ||
OBJDUMP=arm-linux-gnueabihf-objdump | ||
ENV OBJDUMP=arm-linux-gnueabihf-objdump |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
. ci/ci.sh | ||
ci_install | ||
ci_run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed arm-unknown-linux-gnueabihf temporarily, it is currently not supported by
cross
but a PR is in progress.