Improve .travis.ci

This commit is contained in:
Alekos Filini 2020-08-06 18:46:20 +02:00
parent b67bbeb202
commit 82c7e11bd5
No known key found for this signature in database
GPG Key ID: 5E8AFC3034FDFA4F

View File

@ -1,24 +1,56 @@
language: rust language: rust
rust: rust:
- stable - stable
env:
global:
jobs:
- TARGET=x86_64-unknown-linux-gnu CHECK_FMT=1
- TARGET=x86_64-unknown-linux-gnu RUN_TESTS=1
- TARGET=x86_64-unknown-linux-gnu FEATURES=minimal NO_DEFAULT_FEATURES=1
- TARGET=x86_64-unknown-linux-gnu FEATURES=minimal,esplora NO_DEFAULT_FEATURES=1
- TARGET=x86_64-unknown-linux-gnu FEATURES=key-value-db NO_DEFAULT_FEATURES=1
- TARGET=x86_64-unknown-linux-gnu FEATURES=electrum NO_DEFAULT_FEATURES=1
- TARGET=x86_64-unknown-linux-gnu FEATURES=cli-utils,esplora NO_DEFAULT_FEATURES=1
- TARGET=x86_64-unknown-linux-gnu FEATURES=compiler NO_DEFAULT_FEATURES=1
- TARGET=wasm32-unknown-unknown FEATURES=cli-utils,esplora NO_DEFAULT_FEATURES=1
before_script: before_script:
# Install a recent version of clang that supports wasm32 - |
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - if [[ "$TARGET" = "wasm32-unknown-unknown" ]]; then
- sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" # Install a recent version of clang that supports wasm32
- sudo apt-get update wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
- sudo apt-get install -y clang-10 libc6-dev-i386 sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" || exit 1
# Install the required components and targets sudo apt-get update || exit 1
- rustup component add rustfmt sudo apt-get install -y clang-10 libc6-dev-i386 || exit 1
- rustup target add wasm32-unknown-unknown export CC="clang-10"
export CFLAGS="-I/usr/include"
fi
- |
if [[ $CHECK_FMT -eq 1 ]]; then
rustup component add rustfmt
fi
- rustup target add "$TARGET"
script: script:
- cargo fmt -- --check --verbose - |
- cargo test --verbose --all if [[ $CHECK_FMT -eq 1 ]]; then
- cargo build --verbose --all cargo fmt -- --check || exit 1
- cargo build --verbose --no-default-features --features=minimal fi
- cargo build --verbose --no-default-features --features=minimal,esplora - |
- cargo build --verbose --no-default-features --features=key-value-db if [[ $RUN_TESTS -eq 1 ]]; then
- cargo build --verbose --no-default-features --features=electrum CMD=test
- CC="clang-10" CFLAGS="-I/usr/include" cargo build --verbose --no-default-features --features=cli-utils,esplora --target=wasm32-unknown-unknown else
CMD=build
fi
- cargo $CMD --verbose --target=$TARGET --features=$FEATURES $( (( NO_DEFAULT_FEATURES == 1 )) && printf %s '--no-default-features' )
# - cargo fmt -- --check --verbose
# - cargo test --verbose --all
# - cargo build --verbose --all
# - cargo build --verbose --no-default-features --features=minimal
# - cargo build --verbose --no-default-features --features=minimal,esplora
# - cargo build --verbose --no-default-features --features=key-value-db
# - cargo build --verbose --no-default-features --features=electrum
# - CC="clang-10" CFLAGS="-I/usr/include" cargo build --verbose --no-default-features --features=cli-utils,esplora --target=wasm32-unknown-unknown
notifications: notifications:
email: false email: false