Update and rename test.yml to build.yml #1
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
name: Build | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: app/Pog/lib_compiled | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
- name: Remove private test projects | |
run: dotnet sln remove RandomTests RandomBenchmarks | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Publish | |
run: dotnet publish --no-restore Pog | |
- name: Setup PogNative CMake | |
run: cmake -B ./PogNative/cmake-build-release -S ./PogNative -DCMAKE_BUILD_TYPE=Release | |
- name: Build PogNative | |
run: cmake --build ./PogNative/cmake-build-release --config Release | |
- name: Copy VC Redistributable | |
shell: pwsh | |
run: | | |
$SrcDir = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -find VC/Redist/MSVC/*/x64 | |
if ($null -eq $SrcDir) { | |
throw "Could not find VC Redistributable." | |
} | |
ls -Recurse -File $SrcDir | % {Write-Host $_; $_} | cp -Destination .\vc_redist\ | |
- name: Test | |
run: dotnet test --no-restore Pog.Tests | |
- name: Import Pog | |
working-directory: . | |
shell: pwsh | |
run: Import-Module app/Pog |