Skip to content

Commit 880e684

Browse files
committed
play with bash on AppVeyor
Also consistently order and format our two CI files
1 parent c9decd3 commit 880e684

File tree

3 files changed

+67
-106
lines changed

3 files changed

+67
-106
lines changed

.appveyor.yml

Lines changed: 36 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,50 @@
1+
build: off # No Visual Studio auto-build.
12
environment:
2-
global:
3-
PROJECT_NAME: miri
4-
matrix:
5-
- TARGET: i686-pc-windows-msvc
3+
global:
4+
PROJECT_NAME: miri
5+
matrix:
6+
- TARGET: i686-pc-windows-msvc
7+
matrix:
8+
fast_finish: true # Immediately finish build once one of the jobs fails.
9+
cache:
10+
- '%USERPROFILE%\.cargo'
11+
- '%USERPROFILE%\.rustup'
612

713
# branches to build
814
branches:
915
# whitelist
1016
only:
11-
- auto
12-
- try
13-
14-
matrix:
15-
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
16-
17-
cache:
18-
- '%USERPROFILE%\.cargo'
19-
- '%USERPROFILE%\.rustup'
17+
- auto
18+
- try
2019

2120
install:
22-
# Compute the rust version we use
23-
- set /p RUSTC_HASH=<rust-version
24-
# Install Rust
25-
- curl -sSf --retry 3 -o rustup-init.exe https://win.rustup.rs/
26-
- rustup-init.exe -y --default-host %TARGET% --default-toolchain stable --profile minimal
27-
- set PATH=%USERPROFILE%\.cargo\bin;%PATH%
28-
- rustup default stable
29-
- rustup toolchain uninstall beta
30-
- rustup update
31-
# Install "master" toolchain
32-
- cargo install rustup-toolchain-install-master
33-
# We need to install cargo here as well or else the DLL search path inside `cargo run`
34-
# will be for the wrong toolchain. (On Unix, `./miri` takes care of this, but not here.)
35-
- rustup-toolchain-install-master -f -n master %RUSTC_HASH% -c rust-src -c rustc-dev -c cargo
36-
- rustup default master
37-
- rustc --version
38-
- cargo --version
39-
40-
build_script:
41-
- set RUSTFLAGS=-C debug-assertions
42-
# Build and install miri
43-
- cargo build --release --all-features --all-targets --locked
44-
- cargo install --all-features --force --path . --locked --offline
21+
# Compute the Rust version we use.
22+
- set /p RUSTC_HASH=<rust-version
23+
# Install Rust. We use the "stable" toolchain for better caching, it is just used to build `rustup-toolchain-install-master`.
24+
# But we also need to take into account that the build cache might have a different, outdated default.
25+
- curl -sSf --retry 3 -o rustup-init.exe https://win.rustup.rs/
26+
- rustup-init.exe -y --default-host %TARGET% --default-toolchain none --profile minimal
27+
- set PATH=%USERPROFILE%\.cargo\bin;%PATH%
28+
- rustup default stable
29+
- rustup toolchain uninstall beta nightly
30+
- rustup update
31+
# Install "master" toolchain.
32+
# We need to install cargo here as well or else the DLL search path inside `cargo run`
33+
# will be for the wrong toolchain. (On Unix, `./miri` takes care of this, but not here.)
34+
- cargo install rustup-toolchain-install-master
35+
- rustup-toolchain-install-master -f -n master %RUSTC_HASH% -c rust-src -c rustc-dev -c cargo
36+
- rustup default master
37+
- rustc --version
38+
- cargo --version
4539

4640
test_script:
47-
- set RUST_TEST_NOCAPTURE=1
48-
- set RUST_BACKTRACE=1
49-
- set CARGO_INCREMENTAL=0
50-
# Test host miri: 32bit Windows
51-
- cargo miri setup
52-
- set MIRI_SYSROOT=%USERPROFILE%\AppData\Local\rust-lang\miri\cache\HOST
53-
- cargo test --release --all-features --locked
54-
- cd test-cargo-miri
55-
- '"C:\msys64\mingw64\bin\python3.exe" run-test.py'
56-
- cd ..
57-
- ps: $env:MIRI_SYSROOT = ""
58-
# Test foreign miri: 64bit Linux
59-
- cargo miri setup --target x86_64-unknown-linux-gnu
60-
- set MIRI_SYSROOT=%USERPROFILE%\AppData\Local\rust-lang\miri\cache
61-
- set MIRI_TEST_TARGET=x86_64-unknown-linux-gnu
62-
- cargo test --release --all-features --locked
63-
- cd test-cargo-miri
64-
- '"C:\msys64\mingw64\bin\python3.exe" run-test.py'
65-
- cd ..
66-
- ps: $env:MIRI_SYSROOT = ""
67-
# Test foreign miri: 64bit macOS
68-
- cargo miri setup --target x86_64-apple-darwin
69-
- set MIRI_SYSROOT=%USERPROFILE%\AppData\Local\rust-lang\miri\cache
70-
- set MIRI_TEST_TARGET=x86_64-apple-darwin
71-
- cargo test --release --all-features --locked
72-
- cd test-cargo-miri
73-
- '"C:\msys64\mingw64\bin\python3.exe" run-test.py'
74-
- cd ..
75-
- ps: $env:MIRI_SYSROOT = ""
41+
- bash ci.sh
7642

7743
after_test:
78-
# Don't cache "master" toolchain, it's a waste
79-
- rustup default stable
80-
- rustup toolchain uninstall master
44+
# Don't cache "master" toolchain, it's a waste.
45+
- rustup default stable
46+
- rustup toolchain uninstall master
8147

8248
notifications:
83-
- provider: Email
84-
on_build_success: false
49+
- provider: Email
50+
on_build_success: false

.travis.yml

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,57 @@
11
language: generic
2+
os:
3+
- linux
4+
- osx
5+
dist: xenial
26
cache:
37
# Cache the global cargo directory, but NOT the local `target` directory which
48
# we cannot reuse anyway when the nightly changes (and it grows quite large
59
# over time).
610
directories:
7-
- $HOME/.cargo
8-
- $HOME/.rustup
9-
10-
os:
11-
- linux
12-
- osx
13-
dist: xenial
11+
- $HOME/.cargo
12+
- $HOME/.rustup
1413

1514
# Run in PRs and for bors, but not on master.
15+
branches:
16+
only:
17+
- master
18+
- auto
19+
- try
1620
if: branch = auto OR branch = try OR type = pull_request OR type = cron
1721

18-
env:
19-
global:
20-
- RUST_TEST_NOCAPTURE=1
21-
- RUST_BACKTRACE=1
22-
- CARGO_INCREMENTAL=0
23-
2422
before_script:
25-
# Compute the rust version we use. We do not use "language: rust" to have more control here.
23+
# Compute the Rust version we use. We do not use "language: rust" to have more control here.
2624
- |
2725
if [[ "$TRAVIS_EVENT_TYPE" == cron ]]; then
2826
RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
2927
else
3028
RUSTC_HASH=$(cat rust-version)
3129
fi
32-
# Install Rust ("stable" toolchain for better caching, it is just used to build rustup-toolchain-install-master)
33-
- curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain stable --profile minimal
30+
# Install Rust. We use the "stable" toolchain for better caching, it is just used to build `rustup-toolchain-install-master`.
31+
# But we also need to take into account that the build cache might have a different, outdated default.
32+
- curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain none --profile minimal
3433
- export PATH=$HOME/.cargo/bin:$PATH
3534
- rustup default stable
36-
- rustup toolchain uninstall beta
35+
- rustup toolchain uninstall beta nightly
3736
- rustup update
38-
# Install "master" toolchain
37+
# Install "master" toolchain.
3938
- cargo install rustup-toolchain-install-master
4039
- travis_retry rustup-toolchain-install-master -f -n master $RUSTC_HASH -c rust-src -c rustc-dev
4140
- rustup default master
4241
- rustc --version
4342
- cargo --version
4443

4544
script:
46-
- ./travis.sh
45+
- ./ci.sh
4746

4847
before_cache:
49-
# Don't cache "master" toolchain, it's a waste
48+
# Don't cache "master" toolchain, it's a waste.
5049
- rustup default stable
5150
- rustup toolchain uninstall master
5251

5352
notifications:
5453
email:
5554
on_success: never
5655
recipients:
57-
- post+travis@ralfj.de
58-
- travis-miri@oli-obk.de
59-
branches:
60-
only:
61-
- master
62-
- auto
63-
- try
56+
- post+travis@ralfj.de
57+
- travis-miri@oli-obk.de

travis.sh renamed to ci.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
set -euo pipefail
33

44
# Determine configuration
5-
export CARGO_EXTRA_FLAGS="--all-features"
5+
export RUST_TEST_NOCAPTURE=1
6+
export RUST_BACKTRACE=1
67
export RUSTC_EXTRA_FLAGS="-D warnings"
8+
export CARGO_INCREMENTAL=0
9+
export CARGO_EXTRA_FLAGS="--all-features"
710

811
# Prepare
912
echo "Build and install miri"
@@ -33,17 +36,15 @@ function run_tests {
3336

3437
# host
3538
run_tests
36-
# cross-test 32bit Linux from everywhere
37-
MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
3839

39-
if [ "$TRAVIS_OS_NAME" == linux ]; then
40-
# cross-test 64bit macOS from Linux
40+
if [ "${TRAVIS_OS_NAME:-}" == linux ]; then
41+
MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
4142
MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
42-
# cross-test 32bit Windows from Linux
4343
MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
44-
elif [ "$TRAVIS_OS_NAME" == osx ]; then
45-
# cross-test 64bit Windows from macOS
44+
elif [ "${TRAVIS_OS_NAME:-}" == osx ]; then
4645
MIRI_TEST_TARGET=x86_64-pc-windows-msvc run_tests
47-
# cross-test 32bit GNU Windows from macOS
4846
MIRI_TEST_TARGET=i686-pc-windows-gnu run_tests
47+
elif [ "${CI_WINDOWS:-}" == True ]; then
48+
MIRI_TEST_TARGET=x86_64-unknown-linux-gnu run_tests
49+
MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
4950
fi

0 commit comments

Comments
 (0)