Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Action build and test workflow for MSVC (#1201)
- Loading branch information
1 parent
3d83c67
commit 3ff6631
Showing
3 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: MSVC Tests | ||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test-cppwinrt: | ||
strategy: | ||
matrix: | ||
arch: [x86, x64, arm64] | ||
config: [Debug, Release] | ||
exclude: | ||
- arch: arm64 | ||
config: Debug | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Test all | ||
run: | | ||
$VSDevCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find Common7\tools\VSDevCmd.bat | ||
if (!$VSDevCmd) { return 1 } | ||
echo "Using VSDevCmd: ${VSDevCmd}" | ||
cmd /c "${VSDevCmd}" "&" build_test_all.cmd ${{ matrix.arch }} ${{ matrix.config }} | ||
- name: Upload test log | ||
if: matrix.arch != 'arm64' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-output-${{ matrix.arch }}-${{ matrix.config }} | ||
path: "*_results.txt" | ||
|
||
- name: Check test failure | ||
if: matrix.arch != 'arm64' | ||
run: | | ||
if (Test-Path "test_failures.txt") { | ||
Get-Content "test_failures.txt" | ForEach-Object { | ||
Write-Error "error: Test '$_' failed!" | ||
} | ||
return 1 | ||
} | ||
if (!(Test-Path "*_results.txt")) { | ||
Write-Error "error: No test output found!" | ||
return 1 | ||
} | ||
build-nuget: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Package | ||
run: | | ||
$VSDevCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find Common7\tools\VSDevCmd.bat | ||
if (!$VSDevCmd) { return 1 } | ||
echo "Using VSDevCmd: ${VSDevCmd}" | ||
cmd /c "${VSDevCmd}" "&" nuget.exe restore cppwinrt.sln | ||
cmd /c "${VSDevCmd}" "&" build_nuget.cmd | ||
if (!(Test-Path "*.nupkg")) { | ||
Write-Error "error: Output nuget package not found!" | ||
return 1 | ||
} | ||
- name: Upload nuget package artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: package | ||
path: "*.nupkg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters