mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-09-11 05:35:53 +03:00
Fix rust version for windows builds
This commit is contained in:
parent
7c02e4661f
commit
3c3d3dc0c3
9
.github/workflows/package.yml
vendored
9
.github/workflows/package.yml
vendored
@ -493,17 +493,14 @@ jobs:
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: Install Rust
|
||||
run: |
|
||||
.\bin\install_rust.ps1
|
||||
- name: Manage vcpkg cache
|
||||
uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: C:\vcpkg
|
||||
key: ${{ runner.os }}-release-windows-x64
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1.0.6
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
profile: minimal
|
||||
- name: Environment
|
||||
run: .\bin\environment.ps1
|
||||
- name: Install prerequisites
|
||||
|
9
.github/workflows/test.yml
vendored
9
.github/workflows/test.yml
vendored
@ -391,17 +391,14 @@ jobs:
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
ref: ${{ inputs.branch }}
|
||||
- name: Install Rust
|
||||
run: |
|
||||
.\bin\install_rust.ps1
|
||||
- name: Manage vcpkg cache
|
||||
uses: actions/cache@v4.0.2
|
||||
with:
|
||||
path: C:\vcpkg
|
||||
key: ${{ runner.os }}-test-windows-x64
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1.0.6
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
profile: minimal
|
||||
- name: Environment
|
||||
run: .\bin\environment.ps1
|
||||
- name: Install Prerequisites
|
||||
|
24
bin/install_rust.ps1
Normal file
24
bin/install_rust.ps1
Normal file
@ -0,0 +1,24 @@
|
||||
Set-StrictMode -Version latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
write-host -foregroundcolor Cyan "----- install rust -----"
|
||||
|
||||
echo "==== get rust version"
|
||||
$rust_version = ((Get-Content packages/hurl/Cargo.toml) -match '^rust-version')[0].Split('"')[1]
|
||||
echo "rust_version=$rust_version"
|
||||
|
||||
echo "==== get rustup-init.exe installer"
|
||||
Invoke-WebRequest -Uri "https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe" -OutFile "rustup-init.exe"
|
||||
|
||||
echo "==== install rust"
|
||||
Start-Process powershell ".\rustup-init.exe --default-toolchain $rust_version -y" -NoNewWindow -Wait -PassThru
|
||||
|
||||
echo "==== refresh env"
|
||||
$env:Path += ";$env:USERPROFILE\.cargo\bin"
|
||||
[Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Process)
|
||||
rustc --version
|
||||
cargo --version
|
||||
|
||||
echo "==== remove tmp files"
|
||||
Remove-Item -Path .\rustup-init.exe
|
||||
|
Loading…
Reference in New Issue
Block a user