Files
video-shader-toys/.gitea/workflows/ci.yml
Aiden ef829bf3ef
All checks were successful
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Successful in 1m32s
CI / Windows Release Package (push) Successful in 2m20s
Added control interface
2026-05-06 12:55:36 +10:00

179 lines
6.6 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-2022
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Verify Visual Studio ATL
shell: powershell
run: |
$atlHeaders = @(Get-ChildItem -Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC" -Filter atlbase.h -Recurse -ErrorAction SilentlyContinue)
if ($atlHeaders.Count -eq 0) {
Write-Error "Visual Studio Build Tools is missing ATL. Install the 'C++ ATL for latest v143 build tools (x86 & x64)' component, component ID Microsoft.VisualStudio.Component.VC.ATL, then restart the runner service."
exit 1
}
Write-Host "Found ATL header: $($atlHeaders[0].FullName)"
- name: Configure Debug
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
}
Write-Host "Using GPUDIRECT_DIR=$gpudirectDir"
Write-Host "Using SLANG_ROOT=$slangRoot"
cmake --preset vs2022-x64-debug -DGPUDIRECT_DIR="$gpudirectDir" -DSLANG_ROOT="$slangRoot"
- 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-2022
needs:
- native-windows
- ui-ubuntu
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Verify Visual Studio ATL
shell: powershell
run: |
$atlHeaders = @(Get-ChildItem -Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC" -Filter atlbase.h -Recurse -ErrorAction SilentlyContinue)
if ($atlHeaders.Count -eq 0) {
Write-Error "Visual Studio Build Tools is missing ATL. Install the 'C++ ATL for latest v143 build tools (x86 & x64)' component, component ID Microsoft.VisualStudio.Component.VC.ATL, then restart the runner service."
exit 1
}
Write-Host "Found ATL header: $($atlHeaders[0].FullName)"
- name: Build UI
shell: powershell
working-directory: ui
run: |
npm ci --no-audit --no-fund
npm run build
- name: Configure Release
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
}
Write-Host "Using GPUDIRECT_DIR=$gpudirectDir"
Write-Host "Using SLANG_ROOT=$slangRoot"
cmake --preset vs2022-x64-release -DGPUDIRECT_DIR="$gpudirectDir" -DSLANG_ROOT="$slangRoot"
- 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
# Gitea/GHES-compatible runners do not support the v4 artifact backend yet.
uses: actions/upload-artifact@v3
with:
name: VideoShader-windows-release
path: dist/VideoShader.zip