language: rust sudo: required dist: trusty addons: apt: packages: - libssl-dev cache: cargo rust: - stable - beta - nightly os: - linux - osx services: - docker before_script: - if [[ "$INTEGRATION" == "true" ]]; 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 # an entry in stage=test will be generated for each rust/os combination. # each entry will run these commands. script: - cargo test --examples - cargo test --doc - cargo test --lib jobs: allow_failures: - rust: nightly include: - stage: check # do a pre-screen to make sure this is even worth testing script: cargo check --all-targets rust: stable os: linux - stage: integration # make integration tests its own stage script: cargo test --tests env: INTEGRATION=true rust: stable os: linux - script: cargo test --tests # it's a little sad we have to enumerate here env: INTEGRATION=true rust: beta os: linux - script: cargo test --tests env: INTEGRATION=true rust: nightly os: linux - stage: lint # we lint on beta to future-proof name: "Rust: beta, rustfmt" rust: beta os: linux script: - rustup component add rustfmt-preview - cargo fmt -v -- --check - name: "Rust: nightly, rustfmt" # and on nightly with allow_fail rust: nightly os: linux script: - rustup component add rustfmt-preview - cargo fmt -v -- --check - name: "Rust: beta, clippy" rust: beta os: linux script: - rustup component add clippy-preview - touch ./src/lib.rs && cargo clippy -- -D warnings - name: "Rust: nightly, clippy" rust: nightly os: linux script: - rustup component add clippy-preview - touch ./src/lib.rs && cargo clippy -- -D warnings - stage: coverage rust: nightly os: linux env: CACHE_NAME=coverage INTEGRATION=true script: - RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin - cargo tarpaulin --out Xml - bash <(curl -s https://codecov.io/bash) - cargo clean # ensure we don't cache build for coverage stages: - check - test - integration - lint - coverage after_failure: - if [[ "$INTEGRATION" == "true" ]]; then docker logs (docker ps -q); fi