juniper/_build/azure-pipelines-template.yml

72 lines
2.6 KiB
YAML
Raw Permalink Normal View History

2018-10-08 16:45:49 -05:00
jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
stable:
rustup_toolchain: stable
beta:
rustup_toolchain: beta
nightly:
rustup_toolchain: nightly
2019-05-07 05:20:48 -05:00
# TODO: re-enable once new versions are released.
# minimum_supported_version_plus_one:
# rustup_toolchain: 1.32.0
#minimum_supported_version:
# rustup_toolchain: 1.33.0
2018-10-08 16:45:49 -05:00
steps:
- ${{ if ne(parameters.name, 'Windows') }}:
# Linux and macOS.
- script: |
export CARGO_HOME="$HOME/.cargo"
2018-10-08 16:45:49 -05:00
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Install rust
- ${{ if eq(parameters.name, 'Windows') }}:
# Windows.
- script: |
set CARGO_HOME=%USERPROFILE%\.cargo
2018-10-08 16:45:49 -05:00
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"
displayName: Install rust (windows)
# All platforms.
- script: |
rustc -Vv
cargo -V
displayName: Query rust and cargo versions
2018-12-03 18:24:41 -06:00
- ${{ if eq(parameters.name, 'Linux') }}:
# Linux.
- script: _build/cargo-make.sh "0.20.0" "x86_64-unknown-linux-musl"
2018-12-03 18:24:41 -06:00
displayName: Install cargo-make binary
- ${{ if eq(parameters.name, 'macOS') }}:
# Mac.
- script: _build/cargo-make.sh "0.20.0" "x86_64-apple-darwin"
2018-12-03 18:24:41 -06:00
displayName: Install cargo-make binary
- ${{ if eq(parameters.name, 'Windows') }}:
# Windows.
- script: powershell -executionpolicy bypass -file _build/cargo-make.ps1 -version "0.20.0" -target "x86_64-pc-windows-msvc"
2018-12-07 12:57:17 -06:00
displayName: Install cargo-make binary
- ${{ if eq(parameters.name, 'Windows') }}:
# Windows.
- script: |
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
cargo make workspace-ci-flow --no-workspace
env: { CARGO_MAKE_RUN_CODECOV: true }
displayName: Build and run tests
- ${{ if ne(parameters.name, 'Windows') }}:
# Not Windows.
- script: |
export PATH="$PATH:$HOME/.cargo/bin";
cargo make workspace-ci-flow --no-workspace
env: { CARGO_MAKE_RUN_CODECOV: true }
displayName: Build and run tests
- script: |
rustup target add wasm32-unknown-unknown
cargo check --target wasm32-unknown-unknown --package juniper --package juniper_codegen
displayName: Check WebAssembly target
condition: eq(variables['rustup_toolchain'], 'stable')