From 032d0a2a179e19eea1d504ebd8dc6221e5384788 Mon Sep 17 00:00:00 2001 From: Hoverbear Date: Tue, 13 Nov 2018 08:29:31 -0800 Subject: [PATCH 1/2] Add CI Signed-off-by: Hoverbear --- .travis.yml | 40 ++++++++++++++++++++++++++++++++++++++++ appveyor.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .travis.yml create mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..487bf79c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,40 @@ +branches: + only: + # This is where pull requests from "bors r+" are built. + - staging + # This is where pull requests from "bors try" are built. + - trying + # Enable building pull requests. + - master + +language: rust +sudo: false +env: + global: + - RUST_BACKTRACE=1 + - RUSTFLAGS="-D warnings" +cache: cargo + +rust: + +matrix: + include: + # This build uses stable and checks rustfmt and clippy. + # We don't check them on nightly since their lints and formatting may differ. + - rust: stable + install: + - rustup component add rustfmt-preview + - rustup component add clippy-preview + before_script: + - cargo fmt --all -- --check + - cargo clippy --all -- -D clippy + # Since many users will use nightlies, also test that. + - rust: nightly + + +script: + - cargo test --all -- --nocapture + # Validate benches still work. + - cargo bench --all -- --test + # Because failpoints inject failure in code path, which will affect all concurrently running tests, Hence they need to be synchronized, which make tests slow. + - cargo test --tests --features failpoint -- --nocapture diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..9f9bfcb3 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,32 @@ +branches: + only: + # This is where pull requests from "bors r+" are built. + - staging + # This is where pull requests from "bors try" are built. + - trying + # Enable building pull requests. + - master + +environment: + matrix: + - TARGET: x86_64-pc-windows-gnu + RUST_VERSION: stable + - TARGET: x86_64-pc-windows-gnu + RUST_VERSION: nightly + +install: + - curl -sSf -o rustup-init.exe https://win.rustup.rs/ + - rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION% + - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin + - rustc -Vv + - cargo -V + +# Building is done in the test phase, so we disable Appveyor's build phase. +build: false + +cache: + - C:\Users\appveyor\.cargo\registry + - target + +test_script: + - cargo test From ab70fb051b79ae5fad8b96fb09ccc3c77aaee9c2 Mon Sep 17 00:00:00 2001 From: Hoverbear Date: Tue, 13 Nov 2018 09:36:18 -0800 Subject: [PATCH 2/2] Fix travis build Signed-off-by: Hoverbear --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 487bf79c..8e51d238 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,5 +36,3 @@ script: - cargo test --all -- --nocapture # Validate benches still work. - cargo bench --all -- --test - # Because failpoints inject failure in code path, which will affect all concurrently running tests, Hence they need to be synchronized, which make tests slow. - - cargo test --tests --features failpoint -- --nocapture