Skip to content

Commit

Permalink
Only execute conditional steps on success
Browse files Browse the repository at this point in the history
Make sure `succeeded()` is in all the conditionals
  • Loading branch information
alexcrichton committed May 20, 2019
1 parent 9b8af06 commit 12f3701
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/steps/install-clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ steps:
# `clang-ar` by accident.
echo "##vso[task.setvariable variable=AR]ar"
displayName: Install clang (OSX)
condition: eq(variables['Agent.OS'], 'Darwin')
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))

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

# Note that we don't install clang on Linux since its compiler story is just so
Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines/steps/install-sccache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ steps:
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
chmod +x /usr/local/bin/sccache
displayName: Install sccache (OSX)
condition: eq(variables['Agent.OS'], 'Darwin')
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))

- script: |
md sccache
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"
echo ##vso[task.prependpath]%CD%\sccache
displayName: Install sccache (Windows)
condition: eq(variables['Agent.OS'], 'Windows_NT')
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))

# Note that we don't install sccache on Linux since it's installed elsewhere
# through all the containers.
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/steps/install-windows-build-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ steps:
echo ##vso[task.setvariable variable=MSYS_PATH]%MSYS_PATH%
echo ##vso[task.prependpath]%MSYS_PATH%\usr\bin
displayName: Install msys2
condition: eq(variables['Agent.OS'], 'Windows_NT')
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))

# If we need to download a custom MinGW, do so here and set the path
# appropriately.
Expand Down
20 changes: 13 additions & 7 deletions .azure-pipelines/steps/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ steps:
# images, etc.
- bash: |
set -e
pip install setuptools
pip install awscli
displayName: Install awscli
sudo apt-get install -y python3-setuptools
pip3 install awscli --upgrade --user
echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Install awscli (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- script: pip install awscli
displayName: Install awscli (non-Linux)
condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))

- bash: aws s3 help
- bash: exit 1

- checkout: self
fetchDepth: 2

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

- template: install-sccache.yml
- template: install-clang.yml
Expand All @@ -43,7 +49,7 @@ steps:
brew install xz
brew install swig
displayName: Install build dependencies (OSX)
condition: and(eq(variables['Agent.OS'], 'Darwin'), eq(variables['RUST_CHECK_TARGET'],'dist'))
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'), eq(variables['RUST_CHECK_TARGET'],'dist'))

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

Expand All @@ -53,12 +59,12 @@ steps:
set -e
mkdir -p $HOME/rustsrc
$BUILD_SOURCESDIRECTORY/src/ci/init_repo.sh . $HOME/rustsrc
condition: ne(variables['Agent.OS'], 'Windows_NT')
condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
displayName: Check out submodules (Unix)
- script: |
if not exist D:\cache\rustsrc\NUL mkdir D:\cache\rustsrc
sh src/ci/init_repo.sh . /d/cache/rustsrc
condition: eq(variables['Agent.OS'], 'Windows_NT')
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
displayName: Check out submodules (Windows)

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

0 comments on commit 12f3701

Please sign in to comment.