summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Barrios Romero <eldruin@gmail.com>2018-11-20 18:37:29 +0100
committerDiego Barrios Romero <eldruin@gmail.com>2018-11-20 18:37:29 +0100
commit23f62d84d1232b7ef5ec02483a8090aa5c336fa6 (patch)
treeeac297767f552302887ef75ccbb62fb01378637e
parent065e5eab4a0278b77bd0b14167a662776f491921 (diff)
downloadads1x1x-async-23f62d84d1232b7ef5ec02483a8090aa5c336fa6.tar.gz
ads1x1x-async-23f62d84d1232b7ef5ec02483a8090aa5c336fa6.tar.xz
ads1x1x-async-23f62d84d1232b7ef5ec02483a8090aa5c336fa6.zip
Use centralized CI
-rw-r--r--.travis.yml47
-rw-r--r--ci/install.sh20
-rw-r--r--ci/script.sh38
3 files changed, 20 insertions, 85 deletions
diff --git a/.travis.yml b/.travis.yml
index 11656f8..a93a7e9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,25 +2,30 @@ language: rust
# sudo is required to enable kcov to use the personality syscall
sudo: required
-before_script:
- - eval git pull --rebase https://github.com/eldruin/ads1x1x-rs master
- - eval git log --pretty=oneline HEAD~5..HEAD
- - export PATH=$HOME/.cargo/bin:$PATH
+before_install:
+ - git clone https://github.com/eldruin/rust-driver-ci-scripts ci
+ - bash ci/before_install.sh
matrix:
include:
- env: TARGET=x86_64-unknown-linux-gnu
-
- - env: TARGET=x86_64-unknown-linux-gnu COVERAGE=1 LLVM_CONFIG=llvm-config-7
- rust: nightly
+ before_script:
+ - bash ci/coverage_before_script.sh
+ after_success:
+ - bash ci/coverage_after_success.sh
addons:
apt:
- sources:
- - ubuntu-toolchain-r-test
- - sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-7 main'
- key_url: 'http://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- - llvm-7-dev
+ - libcurl4-openssl-dev
+ - libelf-dev
+ - libdw-dev
+ - binutils-dev
+ - cmake
+ sources:
+ - kalakris-cmake
+
+ - env: TARGET=x86_64-unknown-linux-gnu
+ rust: nightly
- env: TARGET=x86_64-unknown-linux-musl
rust: nightly
@@ -43,15 +48,11 @@ matrix:
- env: TARGET=thumbv7m-none-eabi
rust: beta
-before_install:
- - set -e
- - rustup self update
-
install:
- - bash ci/install.sh
+ bash ci/install.sh
script:
- - bash ci/script.sh
+ bash ci/script.sh
after_script: set +e
@@ -61,15 +62,7 @@ cache:
- /home/travis/.cargo
before_cache:
- # Travis can't cache files that are not readable by "others"
- - chmod -R a+r $HOME/.cargo
- - rm -rf /home/travis/.cargo/registry
-
-branches:
- only:
- - master
- - staging
- - trying
+ bash ci/before_cache.sh
notifications:
email:
diff --git a/ci/install.sh b/ci/install.sh
deleted file mode 100644
index dc065f0..0000000
--- a/ci/install.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-set -exo 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
- if [ ! -z $COVERAGE ]; then
- if ! [ -x "$(command -v grcov)" ]; then
- cargo install grcov
- else
- echo "grcov is already installed"
- fi
- fi
-}
-
-main
diff --git a/ci/script.sh b/ci/script.sh
deleted file mode 100644
index b13d9e2..0000000
--- a/ci/script.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-set -exo pipefail
-
-main() {
- if [ ! -z $COVERAGE ] && [ $TRAVIS_RUST_VERSION = nightly ]; then
- export CARGO_INCREMENTAL=0;
- export RUSTFLAGS="-Zprofile -Ccodegen-units=1";
- fi
-
- 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
- if [ ! -z $COVERAGE ]; then
- find . -name "*.gc*" -print
- zip -0 ccov.zip `find . \( -name "ads1x1x*.gc*" -o -name "tier*.gc*" -o -name "mux*.gc*" -o -name "construction*.gc*" -o -name "linux-*.gc*" -o -name "llvmgcov.gc*" \) -print`;
- grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore-dir "/*" > lcov.info;
- bash <(curl -s https://codecov.io/bash) -f lcov.info;
- grcov ./target -t coveralls+ -s . --token `echo "$COVERALLS_TOKEN"` --commit-sha `echo "$TRAVIS_COMMIT"` --llvm --branch --ignore-not-existing --ignore-dir "/*"
- fi
- fi
-
-
-}
-
-main