ci: cd into crate instead of -p $crate (#176)

Cargo is buggy when specifying the crate to run a command against.
This commit is contained in:
Carl Lerche 2019-03-01 09:03:23 -08:00 committed by GitHub
parent 0a234af4ba
commit 749e46b3f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 26 deletions

View File

@ -1,26 +1,28 @@
steps: steps:
- ${{ if not(startsWith(parameters.platform, 'Windows')) }}: # Linux and macOS.
# Linux and macOS. - script: |
- script: | set -e
set -e curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" env:
env: RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}} displayName: "Install rust (*nix)"
displayName: Install rust condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
- ${{ if startsWith(parameters.platform, 'Windows') }}:
# Windows. # Windows.
- script: | - script: |
echo "windows" echo "windows"
curl -sSf -o rustup-init.exe https://win.rustup.rs curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN% rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
set PATH=%PATH%;%USERPROFILE%\.cargo\bin set PATH=%PATH%;%USERPROFILE%\.cargo\bin
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
env: env:
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}} RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
displayName: Install rust (windows) displayName: Install rust (windows)
condition: eq(variables['Agent.OS'], 'Windows_NT')
# All platforms. # All platforms.
- bash: | - script: |
rustc -Vv rustc -Vv
cargo -V cargo -V
displayName: Query rust and cargo versions displayName: Query rust and cargo versions

View File

@ -7,9 +7,7 @@ jobs:
steps: steps:
- template: azure-install-rust.yml - template: azure-install-rust.yml
parameters: parameters:
platform: Linux rust_version: stable
# Pin the version of Rust in case rustfmt changes.
rust_version: 1.32.0
- bash: | - bash: |
rustup component add rustfmt rustup component add rustfmt
displayName: Install rustfmt displayName: Install rustfmt

View File

@ -9,9 +9,9 @@ jobs:
steps: steps:
- template: azure-install-rust.yml - template: azure-install-rust.yml
parameters: parameters:
platform: ${{parameters.name}}
rust_version: stable rust_version: stable
- ${{ each crate in parameters.crates }}: - ${{ each crate in parameters.crates }}:
- script: cargo test -p tower-${{ crate }} - script: cargo test
displayName: cargo test -p tower-${{ crate }} displayName: cargo test -p tower-${{ crate }}
workingDirectory: $(Build.SourcesDirectory)/tower-${{ crate }}