Browse Source

Clone ci scripts into folder

pull/4/head
Diego Barrios Romero 4 years ago
parent
commit
7491105873
  1. 8
      .travis.yml
  2. 13
      ci/install.sh
  3. 26
      ci/script.sh

8
.travis.yml

@ -3,7 +3,7 @@ language: rust
sudo: required
before_script:
bash <(curl -s https://github.com/eldruin/rust-driver-ci-scripts/raw/master/global_before_script.sh)
git clone https://github.com/eldruin/rust-driver-ci-scripts ci
matrix:
include:
@ -54,10 +54,10 @@ before_install:
- rustup self update
install:
bash <(curl -s https://github.com/eldruin/rust-driver-ci-scripts/raw/master/install.sh)
bash ci/install.sh
script:
bash <(curl -s https://github.com/eldruin/rust-driver-ci-scripts/raw/master/script.sh)
bash ci/script.sh
after_script: set +e
@ -67,7 +67,7 @@ cache:
- /home/travis/.cargo
before_cache:
bash <(curl -s https://github.com/eldruin/rust-driver-ci-scripts/raw/master/before_cache.sh)
bash ci/before_cache.sh
branches:
only:

13
ci/install.sh

@ -1,13 +0,0 @@
set -euxo pipefail
main() {
rustup component add rust-src
SYSROOT=$(rustc --print sysroot)
if [[ ! "$SYSROOT" =~ "$TARGET" ]]; then
rustup target add $TARGET
else
echo "Target $TARGET is already installed"
fi
}
main

26
ci/script.sh

@ -1,26 +0,0 @@
set -exo pipefail
main() {
export CARGO_OPTIONS="--target $TARGET"
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 CARGO_OPTIONS="$CARGO_OPTIONS --features $FEATURES"
fi
cargo check $CARGO_OPTIONS
cargo build $CARGO_OPTIONS
if [ -z $DISABLE_EXAMPLES ] && [[ $TARGET =~ .*linux.* ]]; then
cargo build $CARGO_OPTIONS --examples
fi
cargo doc $CARGO_OPTIONS
if [ -z $DISABLE_TESTS ] && [[ $TARGET =~ .*linux.* ]]; then
cargo test $CARGO_OPTIONS
fi
}
main
Loading…
Cancel
Save