Skip to content

Commit

Permalink
[ci] Split jobs into stages for more efficient builds
Browse files Browse the repository at this point in the history
Successful builds will take longer but do slightly less work (faster
once Windows build improvements land — on Travis' side and on Rustup's
side), and important failing builds will take less time on average
(initial smoke test on linux only, then tests on stable win/mac, then
checks on minver, nightlies). No clippy job at all any more.

Most importantly, less concurrent jobs are run — the limit isn't
consumed entirely by a single build; builds fail earlier; stages are
named clearly to communicate what's happening and what's not working.
  • Loading branch information
passcod committed Mar 30, 2019
1 parent 286374d commit 48a2e06
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 40 deletions.
69 changes: 33 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,61 @@ before_cache:
# Travis can't cache files that are not readable by "others"
- chmod -R a+r $HOME/.cargo

matrix:
fast_finish: true
include:
stages:
- smoke (check, audit, test)
- test stables
- check minimum version
- check nightlies

# Audit only
- env: CARGO_AUDIT=1
jobs:
include:
- stage: smoke (check, audit, test)
env: CARGO_SMOKE=1
os: linux

# Stable on windows first to get it going (very slow)
- os: windows
- stage: test stables
env: CARGO_TEST=1
os: windows
- env: CARGO_TEST=1
os: osx

# Linux
- os: linux
rust: nightly
- os: linux
- stage: check minimum version
rust: 1.26.1
- os: linux
os: linux
- rust: 1.26.1
os: windows
- rust: 1.26.1
os: osx

# macOS
- os: osx
- stage: check nightlies
rust: nightly
- os: osx
rust: 1.26.1
- os: osx

# Other windowses later
- os: windows
rust: nightly
- os: windows
rust: 1.26.1

# Clippy only
- env: CARGO_CLIPPY=1

allow_failures:
- env: CARGO_CLIPPY=1
os: linux
- rust: nightly
os: windows
- rust: nightly
os: osx

before_install:
- set -e
- |
if [ $TRAVIS_OS_NAME = windows ]; then
choco install windows-sdk-10.0
fi
if [[ ! -z "$CARGO_AUDIT" ]]; then
if [[ ! -z "$CARGO_SMOKE" ]]; then
which cargo-audit || cargo install --debug cargo-audit
elif [[ ! -z "$CARGO_CLIPPY" ]]; then
rustup component add clippy
fi
# --debug for faster build at the minimal expense of runtime speed

script:
- |
if [[ ! -z "$CARGO_AUDIT" ]]; then
if [[ ! -z "$CARGO_SMOKE" ]]; then
cargo check
cargo audit
elif [[ ! -z "$CARGO_CLIPPY" ]]; then
cargo clippy
else
cargo test
elif [[ ! -z "$CARGO_TEST" ]]; then
cargo test
else
cargo check
fi
after_script: set +e
Expand Down
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name = "notify"
version = "4.0.10"
authors = [
"Félix Saparelli <me@passcod.name>",
"Jorge Israel Peña <jorge.israel.p@gmail.com>",
"Michael Maurizi <michael.maurizi@gmail.com>",
"Pierre Baillet <oct@zoy.org>",
"Joe Wilm <joe@jwilm.com>",
"Daniel Faust <hessijames@gmail.com>"
]
description = "Cross-platform filesystem notification library"
Expand Down

0 comments on commit 48a2e06

Please sign in to comment.