168 lines
5.8 KiB
YAML
168 lines
5.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
- develop
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
native-windows:
|
|
name: Native Windows Build And Tests
|
|
runs-on: windows-latest
|
|
|
|
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 -DGPUDIRECT_DIR="$env:GPUDIRECT_DIR" -DSLANG_ROOT="$env:SLANG_ROOT"
|
|
|
|
- name: Build Debug
|
|
shell: powershell
|
|
run: cmake --build --preset build-debug
|
|
|
|
- name: Run Native Tests
|
|
shell: powershell
|
|
run: cmake --build --preset build-debug --target RUN_TESTS
|
|
|
|
ui-ubuntu:
|
|
name: React UI Build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install UI Dependencies
|
|
working-directory: ui
|
|
run: npm ci --no-audit --no-fund
|
|
|
|
- name: Build UI
|
|
working-directory: ui
|
|
run: npm run build
|
|
|
|
package-windows:
|
|
name: Windows Release Package
|
|
runs-on: windows-latest
|
|
needs:
|
|
- native-windows
|
|
- ui-ubuntu
|
|
|
|
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: Build UI
|
|
shell: powershell
|
|
working-directory: ui
|
|
run: |
|
|
npm ci --no-audit --no-fund
|
|
npm run build
|
|
|
|
- name: Configure Release
|
|
shell: powershell
|
|
run: cmake --preset vs2022-x64-release -DGPUDIRECT_DIR="$env:GPUDIRECT_DIR" -DSLANG_ROOT="$env:SLANG_ROOT"
|
|
|
|
- name: Build Release
|
|
shell: powershell
|
|
run: cmake --build --preset build-release
|
|
|
|
- name: Install Runtime Package
|
|
shell: powershell
|
|
run: cmake --install build/vs2022-x64-release --config Release --prefix dist/VideoShader
|
|
|
|
- name: Zip Runtime Package
|
|
shell: powershell
|
|
run: Compress-Archive -Path dist/VideoShader/* -DestinationPath dist/VideoShader.zip -Force
|
|
|
|
- name: Upload Runtime Package
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: VideoShader-windows-release
|
|
path: dist/VideoShader.zip
|