This commit is contained in:
Christian Legnitto 2018-12-07 11:57:17 -07:00 committed by GitHub
parent 7bb62ff259
commit e6923defb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 8 deletions

View file

@ -17,8 +17,20 @@ env:
- RUSTFLAGS="-C link-dead-code"
- CARGO_MAKE_RUN_CODECOV=true
before_script:
- |
if [ "$TRAVIS_OS_NAME" = 'windows' ]; then
powershell -executionpolicy bypass -file _build/cargo-make.ps1 -version "0.15.3" -target "x86_64-pc-windows-msvc"
fi
- |
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
_build/cargo-make.sh "0.15.3" "x86_64-unknown-linux-musl"
fi
- |
if [ "$TRAVIS_OS_NAME" = 'osx' ]; then
_build/cargo-make.sh "0.15.3" "x86_64-apple-darwin"
fi
script:
- cargo install --debug cargo-make -f
- cargo make workspace-ci-flow --no-workspace
before_deploy:

View file

@ -36,19 +36,16 @@ jobs:
displayName: Query rust and cargo versions
- ${{ if eq(parameters.name, 'Linux') }}:
# Linux.
- script: _build/cargo-make.sh "0.15.1" "x86_64-unknown-linux-musl"
- script: _build/cargo-make.sh "0.15.3" "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"
- script: _build/cargo-make.sh "0.15.3" "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: powershell -executionpolicy bypass -file _build/cargo-make.ps1 -version "0.15.3" -target "x86_64-pc-windows-msvc"
displayName: Install cargo-make binary
- script: cargo make workspace-ci-flow --no-workspace
env: { CARGO_MAKE_RUN_CODECOV: true }
displayName: Build and run tests

21
_build/cargo-make.ps1 Normal file
View file

@ -0,0 +1,21 @@
param (
[Parameter(Mandatory=$true)][string]$version,
[Parameter(Mandatory=$true)][string]$target
)
# Location to put cargo-make binary.
$cargobindir = "$env:userprofile\.cargo\bin"
# Location to stage downloaded zip file.
$zipfile = "$env:temp\cargo-make.zip"
$url = "https://github.com/sagiegurari/cargo-make/releases/download/${version}/cargo-make-v${version}-${target}.zip"
# Download the zip file.
Invoke-WebRequest -Uri $url -OutFile $zipfile
# Extract the binary to the correct location.
Expand-Archive -Path $zipfile -DestinationPath $cargobindir
# Tell azure pipelines the PATH has changed for future steps.
Write-Host "##vso[task.setvariable variable=PATH;]%PATH%;$cargobindir"