Skip to content

Commit 12f3701

Browse files
committed
Only execute conditional steps on success
Make sure `succeeded()` is in all the conditionals
1 parent 9b8af06 commit 12f3701

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

.azure-pipelines/steps/install-clang.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ steps:
1414
# `clang-ar` by accident.
1515
echo "##vso[task.setvariable variable=AR]ar"
1616
displayName: Install clang (OSX)
17-
condition: eq(variables['Agent.OS'], 'Darwin')
17+
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
1818

1919
# If we're compiling for MSVC then we, like most other distribution builders,
2020
# switch to clang as the compiler. This'll allow us eventually to enable LTO
@@ -32,7 +32,7 @@ steps:
3232
%TEMP%\LLVM-7.0.0-win64.exe /S /NCRC /D=%CLANG_DIR%
3333
set RUST_CONFIGURE_ARGS=%RUST_CONFIGURE_ARGS% --set llvm.clang-cl=%CLANG_DIR%\bin\clang-cl.exe
3434
echo ##vso[task.setvariable variable=RUST_CONFIGURE_ARGS]%RUST_CONFIGURE_ARGS%
35-
condition: and(eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['MINGW_URL'],''))
35+
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['MINGW_URL'],''))
3636
displayName: Install clang (Windows)
3737

3838
# Note that we don't install clang on Linux since its compiler story is just so

.azure-pipelines/steps/install-sccache.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ steps:
55
curl -fo /usr/local/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-02-sccache-x86_64-apple-darwin
66
chmod +x /usr/local/bin/sccache
77
displayName: Install sccache (OSX)
8-
condition: eq(variables['Agent.OS'], 'Darwin')
8+
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
99

1010
- script: |
1111
md sccache
1212
powershell -Command "iwr -outf sccache\sccache.exe https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-26-sccache-x86_64-pc-windows-msvc"
1313
echo ##vso[task.prependpath]%CD%\sccache
1414
displayName: Install sccache (Windows)
15-
condition: eq(variables['Agent.OS'], 'Windows_NT')
15+
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
1616

1717
# Note that we don't install sccache on Linux since it's installed elsewhere
1818
# through all the containers.

.azure-pipelines/steps/install-windows-build-deps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ steps:
2929
echo ##vso[task.setvariable variable=MSYS_PATH]%MSYS_PATH%
3030
echo ##vso[task.prependpath]%MSYS_PATH%\usr\bin
3131
displayName: Install msys2
32-
condition: eq(variables['Agent.OS'], 'Windows_NT')
32+
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
3333

3434
# If we need to download a custom MinGW, do so here and set the path
3535
# appropriately.

.azure-pipelines/steps/run.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@ steps:
1212
# images, etc.
1313
- bash: |
1414
set -e
15-
pip install setuptools
16-
pip install awscli
17-
displayName: Install awscli
15+
sudo apt-get install -y python3-setuptools
16+
pip3 install awscli --upgrade --user
17+
echo "##vso[task.prependpath]$HOME/.local/bin"
18+
displayName: Install awscli (Linux)
19+
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
20+
- script: pip install awscli
21+
displayName: Install awscli (non-Linux)
22+
condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))
1823

1924
- bash: aws s3 help
2025
- bash: exit 1
26+
2127
- checkout: self
2228
fetchDepth: 2
2329

@@ -30,7 +36,7 @@ steps:
3036
du . | sort -nr | head -n100
3137
displayName: Show disk usage
3238
# FIXME: this hasn't been tested, but maybe it works on Windows? Should test!
33-
condition: ne(variables['Agent.OS'], 'Windows_NT')
39+
condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
3440

3541
- template: install-sccache.yml
3642
- template: install-clang.yml
@@ -43,7 +49,7 @@ steps:
4349
brew install xz
4450
brew install swig
4551
displayName: Install build dependencies (OSX)
46-
condition: and(eq(variables['Agent.OS'], 'Darwin'), eq(variables['RUST_CHECK_TARGET'],'dist'))
52+
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'), eq(variables['RUST_CHECK_TARGET'],'dist'))
4753

4854
- template: install-windows-build-deps.yml
4955

@@ -53,12 +59,12 @@ steps:
5359
set -e
5460
mkdir -p $HOME/rustsrc
5561
$BUILD_SOURCESDIRECTORY/src/ci/init_repo.sh . $HOME/rustsrc
56-
condition: ne(variables['Agent.OS'], 'Windows_NT')
62+
condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
5763
displayName: Check out submodules (Unix)
5864
- script: |
5965
if not exist D:\cache\rustsrc\NUL mkdir D:\cache\rustsrc
6066
sh src/ci/init_repo.sh . /d/cache/rustsrc
61-
condition: eq(variables['Agent.OS'], 'Windows_NT')
67+
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
6268
displayName: Check out submodules (Windows)
6369

6470
# Configure our CI_JOB_NAME variable which log analyzers can use for the main

0 commit comments

Comments
 (0)