|
| 1 | +jobs: |
| 2 | +- job: ${{ parameters.name }} |
| 3 | + pool: |
| 4 | + vmImage: ${{ parameters.vmImage }} |
| 5 | + strategy: |
| 6 | + matrix: |
| 7 | + stable: |
| 8 | + rustup_toolchain: stable |
| 9 | + beta: |
| 10 | + rustup_toolchain: beta |
| 11 | + nightly: |
| 12 | + rustup_toolchain: nightly |
| 13 | + steps: |
| 14 | + # Linux and macOS. |
| 15 | + - ${{ if ne(parameters.name, 'Windows') }}: |
| 16 | + - script: | |
| 17 | + curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN |
| 18 | + echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" |
| 19 | + displayName: Install rust |
| 20 | + # Windows. |
| 21 | + - ${{ if eq(parameters.name, 'Windows') }}: |
| 22 | + - script: | |
| 23 | + curl -sSf -o rustup-init.exe https://win.rustup.rs |
| 24 | + rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN% |
| 25 | + set PATH=%PATH%;%USERPROFILE%\.cargo\bin |
| 26 | + echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" |
| 27 | + displayName: Install rust (windows) |
| 28 | + # All platforms. |
| 29 | + - script: | |
| 30 | + rustc -Vv |
| 31 | + cargo -V |
| 32 | + displayName: Query rust and cargo versions |
| 33 | + - script: cargo build |
| 34 | + displayName: Build |
| 35 | + # Linux and macOS w/nightly toolchain. |
| 36 | + # Ideally we'd only run the script for the nightly toolchain, but I can't |
| 37 | + # figure out how to determine that within the Azure Pipelines conditional. |
| 38 | + - ${{ if ne(parameters.name, 'Windows') }}: |
| 39 | + - script: | |
| 40 | + if [ "$RUSTUP_TOOLCHAIN" = 'nightly' ] |
| 41 | + then cargo test |
| 42 | + fi |
| 43 | + displayName: Test |
| 44 | + # Windows w/nightly toolchain. |
| 45 | + # Ideally we'd only run the script for the nightly toolchain, but I can't |
| 46 | + # figure out how to determine that within the Azure Pipelines conditional. |
| 47 | + - ${{ if eq(parameters.name, 'Windows') }}: |
| 48 | + - script: if "%RUSTUP_TOOLCHAIN%" == "nightly" cargo test |
| 49 | + displayName: Test |
0 commit comments