Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a PR build workflow #78

Merged
merged 11 commits into from
Jun 4, 2024
41 changes: 41 additions & 0 deletions .github/actions/fix-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Fix environment
description: GitHub VMs aren't configured correctly
# Shamelessly borrowed from https://github.com/microsoft/windows-rs/blob/master/.github/actions/fix-environment/action.yml
runs:
using: "composite"
steps:
- name: Configure environment
shell: pwsh
run: |
switch -Wildcard ("${{ matrix.target }}")
{
"*-pc-windows-gnu"
{
"C:\msys64\mingw64\bin;C:\msys64\mingw32\bin" >> $env:GITHUB_PATH
}
"i686*"
{
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x86" >> $env:GITHUB_PATH
((Resolve-Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\*\bin\Hostx86\x86")
zadjii-msft marked this conversation as resolved.
Show resolved Hide resolved
| Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH
}
"x86_64*"
{
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64" >> $env:GITHUB_PATH
((Resolve-Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\*\bin\Hostx64\x64")
| Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH
}
"aarch64*"
{
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64" >> $env:GITHUB_PATH
((Resolve-Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\*\bin\Hostx64\x64")
| Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH
}
"*"
{
(Join-Path $env:GITHUB_WORKSPACE "target\debug\deps").ToString() >> $env:GITHUB_PATH
(Join-Path $env:GITHUB_WORKSPACE "target\test\debug\deps").ToString() >> $env:GITHUB_PATH
"INCLUDE=C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" `
>> $env:GITHUB_ENV
}
}
5 changes: 4 additions & 1 deletion .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:

jobs:
check:
runs-on: windows-2019
runs-on: windows-2022

strategy:
matrix:
Expand All @@ -35,6 +35,9 @@ jobs:
- name: Install fmt
run: rustup component add rustfmt

- name: Fix environment
uses: ./.github/actions/fix-environment

- name: Clean
run: cargo clean

Expand Down
Loading