-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #1407 - RalfJung:appveyor, r=RalfJung
Share CI code between Travis and AppVeyor
- Loading branch information
Showing
4 changed files
with
75 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,49 @@ | ||
build: off # No Visual Studio auto-build. | ||
environment: | ||
global: | ||
PROJECT_NAME: miri | ||
matrix: | ||
- TARGET: i686-pc-windows-msvc | ||
global: | ||
PROJECT_NAME: miri | ||
matrix: | ||
- TARGET: i686-pc-windows-msvc | ||
matrix: | ||
fast_finish: true # Immediately finish build once one of the jobs fails. | ||
cache: | ||
- '%USERPROFILE%\.cargo' | ||
- '%USERPROFILE%\.rustup' | ||
|
||
# branches to build | ||
branches: | ||
# whitelist | ||
only: | ||
- auto | ||
- try | ||
|
||
matrix: | ||
fast_finish: true # set this flag to immediately finish build once one of the jobs fails. | ||
|
||
cache: | ||
- '%USERPROFILE%\.cargo' | ||
- '%USERPROFILE%\.rustup' | ||
- auto | ||
- try | ||
|
||
install: | ||
# Compute the rust version we use | ||
- set /p RUSTC_HASH=<rust-version | ||
# Install Rust | ||
- curl -sSf --retry 3 -o rustup-init.exe https://win.rustup.rs/ | ||
- rustup-init.exe -y --default-host %TARGET% --default-toolchain stable --profile minimal | ||
- set PATH=%USERPROFILE%\.cargo\bin;%PATH% | ||
- rustup default stable | ||
- rustup toolchain uninstall beta | ||
- rustup update | ||
# Install "master" toolchain | ||
- cargo install rustup-toolchain-install-master | ||
# We need to install cargo here as well or else the DLL search path inside `cargo run` | ||
# will be for the wrong toolchain. (On Unix, `./miri` takes care of this, but not here.) | ||
- rustup-toolchain-install-master -f -n master %RUSTC_HASH% -c rust-src -c rustc-dev -c cargo | ||
- rustup default master | ||
- rustc --version | ||
- cargo --version | ||
|
||
build_script: | ||
- set RUSTFLAGS=-C debug-assertions | ||
# Build and install miri | ||
- cargo build --release --all-features --all-targets --locked | ||
- cargo install --all-features --force --path . --locked --offline | ||
# Compute the Rust version we use. | ||
- set /p RUSTC_HASH=<rust-version | ||
# Install Rust. We use the "stable" toolchain for better caching, it is just used to build `rustup-toolchain-install-master`. | ||
# But we also need to take into account that the build cache might have a different, outdated default. | ||
- curl -sSf --retry 3 -o rustup-init.exe https://win.rustup.rs/ | ||
- rustup-init.exe -y --default-host %TARGET% --default-toolchain none --profile minimal | ||
- set PATH=%USERPROFILE%\.cargo\bin;%PATH% | ||
- rustup default stable | ||
- rustup toolchain uninstall beta nightly | ||
- rustup update | ||
# Install "master" toolchain. | ||
- cargo install rustup-toolchain-install-master | ||
- rustup-toolchain-install-master -f -n master %RUSTC_HASH% -c rust-src -c rustc-dev | ||
- rustup default master | ||
- rustc --version | ||
- cargo --version | ||
|
||
test_script: | ||
- set RUST_TEST_NOCAPTURE=1 | ||
- set RUST_BACKTRACE=1 | ||
- set CARGO_INCREMENTAL=0 | ||
# Test host miri: 32bit Windows | ||
- cargo miri setup | ||
- set MIRI_SYSROOT=%USERPROFILE%\AppData\Local\rust-lang\miri\cache\HOST | ||
- cargo test --release --all-features --locked | ||
- cd test-cargo-miri | ||
- '"C:\msys64\mingw64\bin\python3.exe" run-test.py' | ||
- cd .. | ||
- ps: $env:MIRI_SYSROOT = "" | ||
# Test foreign miri: 64bit Linux | ||
- cargo miri setup --target x86_64-unknown-linux-gnu | ||
- set MIRI_SYSROOT=%USERPROFILE%\AppData\Local\rust-lang\miri\cache | ||
- set MIRI_TEST_TARGET=x86_64-unknown-linux-gnu | ||
- cargo test --release --all-features --locked | ||
- cd test-cargo-miri | ||
- '"C:\msys64\mingw64\bin\python3.exe" run-test.py' | ||
- cd .. | ||
- ps: $env:MIRI_SYSROOT = "" | ||
# Test foreign miri: 64bit macOS | ||
- cargo miri setup --target x86_64-apple-darwin | ||
- set MIRI_SYSROOT=%USERPROFILE%\AppData\Local\rust-lang\miri\cache | ||
- set MIRI_TEST_TARGET=x86_64-apple-darwin | ||
- cargo test --release --all-features --locked | ||
- cd test-cargo-miri | ||
- '"C:\msys64\mingw64\bin\python3.exe" run-test.py' | ||
- cd .. | ||
- ps: $env:MIRI_SYSROOT = "" | ||
- set PYTHON=C:\msys64\mingw64\bin\python3.exe | ||
- bash ci.sh | ||
|
||
after_test: | ||
# Don't cache "master" toolchain, it's a waste | ||
- rustup default stable | ||
- rustup toolchain uninstall master | ||
# Don't cache "master" toolchain, it's a waste. | ||
- rustup default stable | ||
- rustup toolchain uninstall master | ||
|
||
notifications: | ||
- provider: Email | ||
on_build_success: false | ||
- provider: Email | ||
on_build_success: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,57 @@ | ||
language: generic | ||
os: | ||
- linux | ||
- osx | ||
dist: xenial | ||
cache: | ||
# Cache the global cargo directory, but NOT the local `target` directory which | ||
# we cannot reuse anyway when the nightly changes (and it grows quite large | ||
# over time). | ||
directories: | ||
- $HOME/.cargo | ||
- $HOME/.rustup | ||
|
||
os: | ||
- linux | ||
- osx | ||
dist: xenial | ||
- $HOME/.cargo | ||
- $HOME/.rustup | ||
|
||
# Run in PRs and for bors, but not on master. | ||
branches: | ||
only: | ||
- master | ||
- auto | ||
- try | ||
if: branch = auto OR branch = try OR type = pull_request OR type = cron | ||
|
||
env: | ||
global: | ||
- RUST_TEST_NOCAPTURE=1 | ||
- RUST_BACKTRACE=1 | ||
- CARGO_INCREMENTAL=0 | ||
|
||
before_script: | ||
# Compute the rust version we use. We do not use "language: rust" to have more control here. | ||
# Compute the Rust version we use. We do not use "language: rust" to have more control here. | ||
- | | ||
if [[ "$TRAVIS_EVENT_TYPE" == cron ]]; then | ||
RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}') | ||
else | ||
RUSTC_HASH=$(cat rust-version) | ||
fi | ||
# Install Rust ("stable" toolchain for better caching, it is just used to build rustup-toolchain-install-master) | ||
- curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain stable --profile minimal | ||
# Install Rust. We use the "stable" toolchain for better caching, it is just used to build `rustup-toolchain-install-master`. | ||
# But we also need to take into account that the build cache might have a different, outdated default. | ||
- curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain none --profile minimal | ||
- export PATH=$HOME/.cargo/bin:$PATH | ||
- rustup default stable | ||
- rustup toolchain uninstall beta | ||
- rustup toolchain uninstall beta nightly | ||
- rustup update | ||
# Install "master" toolchain | ||
# Install "master" toolchain. | ||
- cargo install rustup-toolchain-install-master | ||
- travis_retry rustup-toolchain-install-master -f -n master $RUSTC_HASH -c rust-src -c rustc-dev | ||
- rustup default master | ||
- rustc --version | ||
- cargo --version | ||
|
||
script: | ||
- ./travis.sh | ||
- ./ci.sh | ||
|
||
before_cache: | ||
# Don't cache "master" toolchain, it's a waste | ||
# Don't cache "master" toolchain, it's a waste. | ||
- rustup default stable | ||
- rustup toolchain uninstall master | ||
|
||
notifications: | ||
email: | ||
on_success: never | ||
recipients: | ||
- [email protected] | ||
- [email protected] | ||
branches: | ||
only: | ||
- master | ||
- auto | ||
- try | ||
- [email protected] | ||
- [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters