summaryrefslogtreecommitdiffstats
path: root/ci/script.sh
diff options
context:
space:
mode:
authorDiego Barrios Romero <eldruin@gmail.com>2018-11-04 21:34:05 +0100
committerDiego Barrios Romero <eldruin@gmail.com>2018-11-04 21:34:05 +0100
commitd863037e60340e9765c13bf707092dd32f958a42 (patch)
tree6d2c6eb6924067ba2fb215c98f0f37dcada905d9 /ci/script.sh
parent5a5d08f92768c48949cb175605055b853e559c5c (diff)
downloadads1x1x-async-d863037e60340e9765c13bf707092dd32f958a42.tar.gz
ads1x1x-async-d863037e60340e9765c13bf707092dd32f958a42.tar.xz
ads1x1x-async-d863037e60340e9765c13bf707092dd32f958a42.zip
Add CI
Diffstat (limited to 'ci/script.sh')
-rw-r--r--ci/script.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/ci/script.sh b/ci/script.sh
new file mode 100644
index 0000000..9ad8677
--- /dev/null
+++ b/ci/script.sh
@@ -0,0 +1,24 @@
+set -exo pipefail
+
+main() {
+ if [[ ! $TARGET =~ .*linux.* ]]; then
+ sed -i "s/linux-embedded-hal/#linux-embedded-hal/g" Cargo.toml
+ sed -i "s/embedded-hal-mock/#embedded-hal-mock/g" Cargo.toml
+ fi
+
+ if [ ! -z $FEATURES ]; then
+ export FEATURES="--features $FEATURES"
+ fi
+
+ cargo check --target $TARGET $FEATURES
+ cargo build --target $TARGET --release $FEATURES
+ if [ -z $DISABLE_EXAMPLES ] && [[ $TARGET =~ .*linux.* ]]; then
+ cargo build --target $TARGET $FEATURES --examples
+ fi
+
+ if [ -z $DISABLE_TESTS ] && [ $TRAVIS_RUST_VERSION = nightly ] && [[ $TARGET =~ .*linux.* ]]; then
+ cargo test --target $TARGET $FEATURES
+ fi
+}
+
+main