Use pre-compiled cargo-make (#281)

This commit is contained in:
Christian Legnitto 2018-12-03 16:24:41 -08:00 committed by GitHub
parent e2212a539a
commit fe2bf611bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 2 deletions

View file

@ -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

18
_build/cargo-make.sh Executable file
View file

@ -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"