Skip to content

Commit e6923de

Browse files
authored
Fix CI (#288)
1 parent 7bb62ff commit e6923de

File tree

3 files changed

+38
-8
lines changed

3 files changed

+38
-8
lines changed

.travis.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,20 @@ env:
1717
- RUSTFLAGS="-C link-dead-code"
1818
- CARGO_MAKE_RUN_CODECOV=true
1919

20+
before_script:
21+
- |
22+
if [ "$TRAVIS_OS_NAME" = 'windows' ]; then
23+
powershell -executionpolicy bypass -file _build/cargo-make.ps1 -version "0.15.3" -target "x86_64-pc-windows-msvc"
24+
fi
25+
- |
26+
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
27+
_build/cargo-make.sh "0.15.3" "x86_64-unknown-linux-musl"
28+
fi
29+
- |
30+
if [ "$TRAVIS_OS_NAME" = 'osx' ]; then
31+
_build/cargo-make.sh "0.15.3" "x86_64-apple-darwin"
32+
fi
2033
script:
21-
- cargo install --debug cargo-make -f
2234
- cargo make workspace-ci-flow --no-workspace
2335

2436
before_deploy:

_build/azure-pipelines-template.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,16 @@ jobs:
3636
displayName: Query rust and cargo versions
3737
- ${{ if eq(parameters.name, 'Linux') }}:
3838
# Linux.
39-
- script: _build/cargo-make.sh "0.15.1" "x86_64-unknown-linux-musl"
39+
- script: _build/cargo-make.sh "0.15.3" "x86_64-unknown-linux-musl"
4040
displayName: Install cargo-make binary
4141
- ${{ if eq(parameters.name, 'macOS') }}:
4242
# Mac.
43-
- script: _build/cargo-make.sh "0.15.1" "x86_64-apple-darwin"
43+
- script: _build/cargo-make.sh "0.15.3" "x86_64-apple-darwin"
4444
displayName: Install cargo-make binary
4545
- ${{ if eq(parameters.name, 'Windows') }}:
4646
# Windows.
47-
- script: |
48-
# TODO: There is no build of cargo-make for windows yet.
49-
cargo install -f cargo-make --vers 0.15.1
50-
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
51-
displayName: Install cargo-make
47+
- script: powershell -executionpolicy bypass -file _build/cargo-make.ps1 -version "0.15.3" -target "x86_64-pc-windows-msvc"
48+
displayName: Install cargo-make binary
5249
- script: cargo make workspace-ci-flow --no-workspace
5350
env: { CARGO_MAKE_RUN_CODECOV: true }
5451
displayName: Build and run tests

_build/cargo-make.ps1

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
param (
2+
[Parameter(Mandatory=$true)][string]$version,
3+
[Parameter(Mandatory=$true)][string]$target
4+
)
5+
6+
# Location to put cargo-make binary.
7+
$cargobindir = "$env:userprofile\.cargo\bin"
8+
9+
# Location to stage downloaded zip file.
10+
$zipfile = "$env:temp\cargo-make.zip"
11+
12+
$url = "https://github.com/sagiegurari/cargo-make/releases/download/${version}/cargo-make-v${version}-${target}.zip"
13+
14+
# Download the zip file.
15+
Invoke-WebRequest -Uri $url -OutFile $zipfile
16+
17+
# Extract the binary to the correct location.
18+
Expand-Archive -Path $zipfile -DestinationPath $cargobindir
19+
20+
# Tell azure pipelines the PATH has changed for future steps.
21+
Write-Host "##vso[task.setvariable variable=PATH;]%PATH%;$cargobindir"

0 commit comments

Comments
 (0)