Specifically, if a test doesn't clean up nicely after itself, running it a second time for checking coverage might make it fail! We restart the docker server so that all the server state is erased, which should mitigate that.
51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
language: rust
|
|
sudo: required
|
|
dist: trusty
|
|
addons:
|
|
apt:
|
|
packages:
|
|
- libssl-dev
|
|
|
|
cache: cargo
|
|
rust:
|
|
- stable
|
|
- beta
|
|
- nightly
|
|
os:
|
|
- linux
|
|
- osx
|
|
matrix:
|
|
allow_failures:
|
|
- rust: nightly
|
|
|
|
services:
|
|
- docker
|
|
before_install:
|
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
|
docker pull greenmail/standalone:1.5.8 &&
|
|
docker run -d -e GREENMAIL_OPTS='-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose' -p 3025:3025 -p 3110:3110 -p 3143:3143 -p 3465:3465 -p 3993:3993 -p 3995:3995 greenmail/standalone:1.5.8;
|
|
fi
|
|
script:
|
|
- cargo clean
|
|
- cargo check --all-targets
|
|
- cargo test --doc
|
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
|
cargo test --tests;
|
|
else
|
|
cargo test --lib;
|
|
fi
|
|
|
|
before_cache: |
|
|
if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == nightly ]]; then
|
|
RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin
|
|
fi
|
|
|
|
after_failure:
|
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker logs (docker ps -q); fi
|
|
|
|
after_success: |
|
|
if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == nightly ]]; then
|
|
docker restart -t 1 (docker ps -q);
|
|
cargo tarpaulin --out Xml;
|
|
bash <(curl -s https://codecov.io/bash);
|
|
fi
|