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

View File

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

View File

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