aboutsummaryrefslogtreecommitdiff
path: root/ci/script.sh
diff options
context:
space:
mode:
authorTill Höppner2016-03-17 13:15:37 +0100
committerTill Höppner2016-03-17 13:45:37 +0100
commit435db78809fb7b22bbcdbd9df45dded44e500510 (patch)
tree32baeaea0dfc5f58ebaf67d6a3ab9bebb89e6bbe /ci/script.sh
parent155971b36c100c0c146492375d5580ef0c5ac572 (diff)
downloadilc-435db78809fb7b22bbcdbd9df45dded44e500510.tar.gz
ilc-435db78809fb7b22bbcdbd9df45dded44e500510.tar.xz
ilc-435db78809fb7b22bbcdbd9df45dded44e500510.zip
Update CI from japaric/rust-everywhere
Diffstat (limited to 'ci/script.sh')
-rw-r--r--ci/script.sh40
1 files changed, 30 insertions, 10 deletions
diff --git a/ci/script.sh b/ci/script.sh
index 3dd9a1b..7dbd352 100644
--- a/ci/script.sh
+++ b/ci/script.sh
@@ -2,35 +2,55 @@
set -ex
-# TODO modify this phase as you see fit
# PROTIP Always pass `--target $TARGET` to cargo commands, this makes cargo output build artifacts
# to target/$TARGET/{debug,release} which can reduce the number of needed conditionals in the
# `before_deploy`/packaging phase
+case "$TRAVIS_OS_NAME" in
+ linux)
+ host=x86_64-unknown-linux-gnu
+ ;;
+ osx)
+ host=x86_64-apple-darwin
+ ;;
+esac
+
+# NOTE Workaround for rust-lang/rust#31907 - disable doc tests when cross compiling
+# This has been fixed in the nightly channel but it would take a while to reach the other channels
+if [ "$host" != "$TARGET" ] && [ "$CHANNEL" != "nightly" ]; then
+ if [ "$TRAVIS_OS_NAME" = "osx" ]; then
+ brew install gnu-sed --default-names
+ fi
+
+ find src -name '*.rs' -type f | xargs sed -i -e 's:\(//.\s*```\):\1 ignore,:g'
+fi
+
case $TARGET in
# use an emulator to run the cross compiled binaries
arm-unknown-linux-gnueabihf)
# build tests but don't run them
- cargo test --target $TARGET --no-run
+ # cargo test --target $TARGET --no-run
# run tests in emulator
- find target/$TARGET/debug -maxdepth 1 -executable -type f | \
- xargs qemu-arm -L /usr/arm-linux-gnueabihf
+ # find target/$TARGET/debug -maxdepth 1 -executable -type f \
+ # -exec qemu-arm -L /usr/arm-linux-gnueabihf '{}' ';'
# build the main executable
- cargo build --target $TARGET
+ cargo build --target $TARGET --verbose
- # run the main executable using the emulator
+ # sanity check the file type
+ file target/$TARGET/debug/ilc
qemu-arm -L /usr/arm-linux-gnueabihf target/$TARGET/debug/ilc -V
;;
*)
cargo build --target $TARGET --verbose
+
+ # sanity check the file type
+ file target/$TARGET/debug/ilc
+ target/$TARGET/debug/ilc -V
+
# this isn't even a temporary solution. :(
# cargo test --target $TARGET --verbose
;;
esac
-cargo build --target $TARGET --release
-
-# sanity check the file type
-file target/$TARGET/release/ilc