Move this to the before_script phase

The build cache gets stored after the `script` phase, but before the
`after_success`/`after_failure` phase, so the built cargo-tarpaulin
wasn't getting cached
master
Paul Woolcock 6 years ago
parent 67ab7ee59a
commit 39e5aacfb5
  1. 7
      .travis.yml

@ -22,15 +22,16 @@ rust:
before_script: before_script:
- | - |
if [[ "$TRAVIS_RUST_VERSION" == "nightly"* ]]; then rustup component add rustfmt-preview; fi if [[ "$TRAVIS_RUST_VERSION" == "nightly"* ]]; then rustup component add rustfmt-preview; fi
- |
if [[ "$TRAVIS_RUST_VERSION" == stable ]] 2> /dev/null && [ -z "$ELEFREN_FEATURES" ] 2>/dev/null && [[ "$TRAVIS_OS_NAME" == "linux" ]] 2>/dev/null && [[ -z "$(which cargo-tarpaulin)" ]]; then
RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin
fi
script: script:
- | - |
if [[ "$TRAVIS_RUST_VERSION" == "nightly"* ]]; then cargo fmt --all -- --check; fi if [[ "$TRAVIS_RUST_VERSION" == "nightly"* ]]; then cargo fmt --all -- --check; fi
- cargo test $ELEFREN_FEATURES - cargo test $ELEFREN_FEATURES
after_success: | after_success: |
if [[ "$TRAVIS_RUST_VERSION" == stable ]] 2> /dev/null && [ -z "$ELEFREN_FEATURES" ] 2>/dev/null && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then if [[ "$TRAVIS_RUST_VERSION" == stable ]] 2> /dev/null && [ -z "$ELEFREN_FEATURES" ] 2>/dev/null && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ -z "$(which cargo-tarpaulin)" ]]; then
RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin
fi
cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID --features toml cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID --features toml
fi fi
matrix: matrix:

Loading…
Cancel
Save