diff --git a/_build/azure-pipelines-template.yml b/_build/azure-pipelines-template.yml index 06ab6b4c..13177e7f 100644 --- a/_build/azure-pipelines-template.yml +++ b/_build/azure-pipelines-template.yml @@ -34,8 +34,21 @@ jobs: rustc -Vv cargo -V displayName: Query rust and cargo versions - - script: cargo install -f cargo-make - displayName: Install cargo-make + - ${{ if eq(parameters.name, 'Linux') }}: + # Linux. + - script: _build/cargo-make.sh "0.15.1" "x86_64-unknown-linux-musl" + displayName: Install cargo-make binary + - ${{ if eq(parameters.name, 'macOS') }}: + # Mac. + - script: _build/cargo-make.sh "0.15.1" "x86_64-apple-darwin" + displayName: Install cargo-make binary + - ${{ if eq(parameters.name, 'Windows') }}: + # Windows. + - script: | + # TODO: There is no build of cargo-make for windows yet. + cargo install -f cargo-make --vers 0.15.1 + echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" + displayName: Install cargo-make - script: cargo make workspace-ci-flow --no-workspace env: { CARGO_MAKE_RUN_CODECOV: true } displayName: Build and run tests diff --git a/_build/cargo-make.sh b/_build/cargo-make.sh new file mode 100755 index 00000000..8fe64233 --- /dev/null +++ b/_build/cargo-make.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if [ -z ${1+x} ]; +then + echo "Missing version as first argument"; + exit 1 +fi + +if [ -z ${2+x} ]; +then + echo "Missing target as second argument"; + exit 1 +fi + +curl https://github.com/sagiegurari/cargo-make/releases/download/${1}/cargo-make-v${1}-${2}.zip -sSfL -o /tmp/cargo-make.zip; +unzip /tmp/cargo-make.zip; +mv cargo-make-*/* $HOME/.cargo/bin; +echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"