aboutsummaryrefslogtreecommitdiff
path: root/ci/script.sh
diff options
context:
space:
mode:
authorTill Höppner2016-02-23 17:00:53 +0100
committerTill Höppner2016-02-24 18:36:04 +0100
commitf01c278a26e0f248d188c10bdb852b0859b98b3b (patch)
tree3e729bf243011111a20b84f24aea3fbcb9f595f5 /ci/script.sh
parent815f31f5cef61709c50087c9f7601ea330929bb7 (diff)
downloadilc-f01c278a26e0f248d188c10bdb852b0859b98b3b.tar.gz
ilc-f01c278a26e0f248d188c10bdb852b0859b98b3b.tar.xz
ilc-f01c278a26e0f248d188c10bdb852b0859b98b3b.zip
Test CI
Diffstat (limited to 'ci/script.sh')
-rw-r--r--ci/script.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/ci/script.sh b/ci/script.sh
new file mode 100644
index 0000000..3dd9a1b
--- /dev/null
+++ b/ci/script.sh
@@ -0,0 +1,36 @@
+# `script` phase: you usually build, test and generate docs in this phase
+
+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 $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
+
+ # run tests in emulator
+ find target/$TARGET/debug -maxdepth 1 -executable -type f | \
+ xargs qemu-arm -L /usr/arm-linux-gnueabihf
+
+ # build the main executable
+ cargo build --target $TARGET
+
+ # run the main executable using the emulator
+ qemu-arm -L /usr/arm-linux-gnueabihf target/$TARGET/debug/ilc -V
+ ;;
+ *)
+ cargo build --target $TARGET --verbose
+ # 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