|
1 | 1 | language: rust |
2 | | -sudo: required |
3 | | -dist: trusty |
4 | | -addons: |
5 | | - apt: |
6 | | - packages: |
7 | | - - libssl-dev |
8 | 2 | cache: cargo |
9 | 3 | rust: |
10 | 4 | - stable |
11 | 5 | - beta |
12 | 6 | - nightly |
13 | | -matrix: |
| 7 | +os: linux |
| 8 | + |
| 9 | +# always test things that aren't pushes (like PRs) |
| 10 | +# never test tags or pushes to non-master branches (wait for PR) |
| 11 | +# https://github.com/travis-ci/travis-ci/issues/2200#issuecomment-441395545) |
| 12 | +if: type != push OR (tag IS blank AND branch = master) |
| 13 | + |
| 14 | +jobs: |
14 | 15 | allow_failures: |
15 | 16 | - rust: nightly |
16 | | -after_success: | |
17 | | - if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then |
18 | | - bash <(curl https://raw.githubusercontent.com/xd009642/tarpaulin/master/travis-install.sh) |
19 | | - cargo tarpaulin --out Xml |
20 | | - bash <(curl -s https://codecov.io/bash) |
21 | | - fi |
| 17 | + include: |
| 18 | + - &check |
| 19 | + stage: check # do a pre-screen to make sure this is even worth testing |
| 20 | + script: cargo check --all-targets |
| 21 | + rust: stable |
| 22 | + - <<: *check # also test oldest known-good stable |
| 23 | + rust: 1.31.1 |
| 24 | + - stage: test |
| 25 | + rust: stable |
| 26 | + os: osx |
| 27 | + - rust: stable |
| 28 | + os: windows |
| 29 | + - stage: lint # we lint on beta to future-proof |
| 30 | + name: "Rust: beta, rustfmt" |
| 31 | + rust: beta |
| 32 | + script: |
| 33 | + - rustup component add rustfmt-preview |
| 34 | + - cargo fmt -v -- --check |
| 35 | + - name: "Rust: nightly, rustfmt" # and on nightly with allow_fail |
| 36 | + rust: nightly |
| 37 | + script: |
| 38 | + - rustup component add rustfmt-preview |
| 39 | + - cargo fmt -v -- --check |
| 40 | + - name: "Rust: beta, clippy" |
| 41 | + rust: beta |
| 42 | + script: |
| 43 | + - rustup component add clippy-preview |
| 44 | + - touch ./src/lib.rs && cargo clippy -- -D warnings |
| 45 | + - name: "Rust: nightly, clippy" |
| 46 | + rust: nightly |
| 47 | + script: |
| 48 | + - rustup component add clippy-preview |
| 49 | + - touch ./src/lib.rs && cargo clippy -- -D warnings |
| 50 | + - stage: coverage |
| 51 | + sudo: required |
| 52 | + addons: |
| 53 | + apt: |
| 54 | + packages: |
| 55 | + - libssl-dev |
| 56 | + rust: nightly |
| 57 | + env: CACHE_NAME=coverage |
| 58 | + script: |
| 59 | + - RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin || true |
| 60 | + - cargo tarpaulin --out Xml |
| 61 | + - bash <(curl -s https://codecov.io/bash) |
| 62 | + - cargo clean -p msql-srv # ensure we don't cache build for coverage |
| 63 | +stages: |
| 64 | + - check |
| 65 | + - test |
| 66 | + - lint |
| 67 | + - coverage |
0 commit comments