From 99e8fb468132017d6944e12fa2b7df021e79f7d7 Mon Sep 17 00:00:00 2001 From: Aiden Date: Wed, 6 May 2026 12:11:51 +1000 Subject: [PATCH] Updated runner --- .gitea/workflows/ci.yml | 88 +++++++++++++++++++++++++++++++++++++++-- README.md | 16 +++++++- 2 files changed, 98 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 038d7d7..fa19e42 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -12,15 +12,55 @@ on: jobs: native-windows: name: Native Windows Build And Tests - runs-on: windows-latest + runs-on: windows-2022 steps: - name: Checkout uses: actions/checkout@v4 + - name: Resolve Native Third Party Dependencies + shell: powershell + run: | + $gpudirectDir = "${{ vars.GPUDIRECT_DIR }}" + if ([string]::IsNullOrWhiteSpace($gpudirectDir)) { + $gpudirectDir = $env:GPUDIRECT_DIR + } + if ([string]::IsNullOrWhiteSpace($gpudirectDir)) { + $gpudirectDir = Join-Path $PWD "3rdParty\Blackmagic DeckLink SDK 16.0\Win\Samples\NVIDIA_GPUDirect" + } + + $slangRoot = "${{ vars.SLANG_ROOT }}" + if ([string]::IsNullOrWhiteSpace($slangRoot)) { + $slangRoot = $env:SLANG_ROOT + } + if ([string]::IsNullOrWhiteSpace($slangRoot)) { + $slangRoot = Join-Path $PWD "3rdParty\slang-2026.8-windows-x86_64" + } + + $requiredFiles = @( + (Join-Path $gpudirectDir "include\DVPAPI.h"), + (Join-Path $gpudirectDir "lib\x64\dvp.lib"), + (Join-Path $gpudirectDir "bin\x64\dvp.dll"), + (Join-Path $slangRoot "bin\slangc.exe"), + (Join-Path $slangRoot "bin\slang-compiler.dll"), + (Join-Path $slangRoot "bin\slang-glslang.dll"), + (Join-Path $slangRoot "LICENSE") + ) + + $missingFiles = @($requiredFiles | Where-Object { -not (Test-Path -LiteralPath $_) }) + if ($missingFiles.Count -gt 0) { + Write-Error "Missing native third-party dependencies. Set Gitea repository variables GPUDIRECT_DIR and SLANG_ROOT, or pre-populate the repo-local 3rdParty folder on the Windows runner. Missing: $($missingFiles -join ', ')" + exit 1 + } + + "GPUDIRECT_DIR=$gpudirectDir" | Out-File -FilePath $env:GITHUB_ENV -Append + "SLANG_ROOT=$slangRoot" | Out-File -FilePath $env:GITHUB_ENV -Append + Write-Host "Using GPUDIRECT_DIR=$gpudirectDir" + Write-Host "Using SLANG_ROOT=$slangRoot" + - name: Configure Debug shell: powershell - run: cmake --preset vs2022-x64-debug + run: cmake --preset vs2022-x64-debug -DGPUDIRECT_DIR="$env:GPUDIRECT_DIR" -DSLANG_ROOT="$env:SLANG_ROOT" - name: Build Debug shell: powershell @@ -48,7 +88,7 @@ jobs: package-windows: name: Windows Release Package - runs-on: windows-latest + runs-on: windows-2022 needs: - native-windows - ui-ubuntu @@ -57,6 +97,46 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Resolve Native Third Party Dependencies + shell: powershell + run: | + $gpudirectDir = "${{ vars.GPUDIRECT_DIR }}" + if ([string]::IsNullOrWhiteSpace($gpudirectDir)) { + $gpudirectDir = $env:GPUDIRECT_DIR + } + if ([string]::IsNullOrWhiteSpace($gpudirectDir)) { + $gpudirectDir = Join-Path $PWD "3rdParty\Blackmagic DeckLink SDK 16.0\Win\Samples\NVIDIA_GPUDirect" + } + + $slangRoot = "${{ vars.SLANG_ROOT }}" + if ([string]::IsNullOrWhiteSpace($slangRoot)) { + $slangRoot = $env:SLANG_ROOT + } + if ([string]::IsNullOrWhiteSpace($slangRoot)) { + $slangRoot = Join-Path $PWD "3rdParty\slang-2026.8-windows-x86_64" + } + + $requiredFiles = @( + (Join-Path $gpudirectDir "include\DVPAPI.h"), + (Join-Path $gpudirectDir "lib\x64\dvp.lib"), + (Join-Path $gpudirectDir "bin\x64\dvp.dll"), + (Join-Path $slangRoot "bin\slangc.exe"), + (Join-Path $slangRoot "bin\slang-compiler.dll"), + (Join-Path $slangRoot "bin\slang-glslang.dll"), + (Join-Path $slangRoot "LICENSE") + ) + + $missingFiles = @($requiredFiles | Where-Object { -not (Test-Path -LiteralPath $_) }) + if ($missingFiles.Count -gt 0) { + Write-Error "Missing native third-party dependencies. Set Gitea repository variables GPUDIRECT_DIR and SLANG_ROOT, or pre-populate the repo-local 3rdParty folder on the Windows runner. Missing: $($missingFiles -join ', ')" + exit 1 + } + + "GPUDIRECT_DIR=$gpudirectDir" | Out-File -FilePath $env:GITHUB_ENV -Append + "SLANG_ROOT=$slangRoot" | Out-File -FilePath $env:GITHUB_ENV -Append + Write-Host "Using GPUDIRECT_DIR=$gpudirectDir" + Write-Host "Using SLANG_ROOT=$slangRoot" + - name: Build UI shell: powershell working-directory: ui @@ -66,7 +146,7 @@ jobs: - name: Configure Release shell: powershell - run: cmake --preset vs2022-x64-release + run: cmake --preset vs2022-x64-release -DGPUDIRECT_DIR="$env:GPUDIRECT_DIR" -DSLANG_ROOT="$env:SLANG_ROOT" - name: Build Release shell: powershell diff --git a/README.md b/README.md index 64dfe08..de87641 100644 --- a/README.md +++ b/README.md @@ -224,10 +224,22 @@ Only `runtime/templates/` and `runtime/README.md` are tracked. The Gitea workflow expects two act runners: -- `windows-latest`: builds the native app and runs native tests. +- `windows-2022`: builds the native app and runs native tests. - `ubuntu-latest`: installs UI dependencies and runs the Vite build. -If your Windows runner stores the Blackmagic SDK outside the repo, configure `GPUDIRECT_DIR` in the runner environment or adjust the workflow configure command to pass `-DGPUDIRECT_DIR=...`. +The Windows jobs validate native third-party dependencies before configuring CMake. Because `3rdParty/` is ignored, configure these paths on the runner or in Gitea repository variables: + +- `GPUDIRECT_DIR`: path to `Blackmagic DeckLink SDK 16.0/Win/Samples/NVIDIA_GPUDirect`. +- `SLANG_ROOT`: path to the Slang binary release folder containing `bin/slangc.exe`. + +Example runner paths: + +```text +D:\SDKs\Blackmagic DeckLink SDK 16.0\Win\Samples\NVIDIA_GPUDirect +D:\SDKs\slang-2026.8-windows-x86_64 +``` + +If neither variable is set, the workflow falls back to the repo-local defaults under `3rdParty/`. ## Still Todo