Skip to content

Commit

Permalink
CI: Add basic CI which builds Pog and runs Pog.Tests
Browse files Browse the repository at this point in the history
TODO: bootstrap 7zip and OpenedFilesView, test that Pog is able to install a package
  • Loading branch information
MatejKafka committed Apr 2, 2024
1 parent bb8b694 commit 3e3fe99
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
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: Install ILRepack
shell: pwsh
run: |
iwr https://www.nuget.org/api/v2/package/ILRepack/2.0.29 -OutFile $env:TEMP\ilrepack.nupkg
Expand-Archive $env:TEMP\ilrepack.nupkg $env:TEMP\ilrepack
# add to PATH for following steps
Add-Content $env:GITHUB_PATH $env:TEMP\ilrepack\tools
- name: Install bootstrap 7zip
working-directory: ..
shell: pwsh
run: |
iwr https://www.7-zip.org/a/7z2403-x64.exe -OutFile $env:TEMP\7zip.exe
Start-Process -Wait $env:TEMP\7zip.exe -ArgumentList /S, /D=$(pwd)\7zip\app
# just a stub manifest, will be replaced later
Set-Content "$(pwd)\7zip\pog.psd1" '@{Private = $true; Enable = {Export-Command "7z" "./app/7z.exe" -VcRedist}}'
- 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 | select -Last 1) | % {Write-Host $_; $_} | cp -Destination .\vc_redist\
- name: Pog.Tests
run: dotnet test --no-restore Pog.Tests

- name: Setup Pog
working-directory: .
shell: pwsh
run: |
.\setup.ps1
pog 7zip -Force

0 comments on commit 3e3fe99

Please sign in to comment.