From e88a4a1f3bc88901346e43076fe9a33df85b7fa2 Mon Sep 17 00:00:00 2001 From: Aiden Date: Sat, 30 May 2026 14:41:20 +1000 Subject: [PATCH] CI/CD updates --- .gitea/workflows/ci.yml | 156 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 144 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 0525436..bd3efc4 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -18,8 +18,30 @@ jobs: runs-on: windows-2022 steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Manual Checkout With LFS Submodules + shell: powershell + env: + GITEA_PAT: ${{ secrets.TOKEN }} + run: | + $repoUrl = "https://aiden:${env:GITEA_PAT}@git.f-40.com/aiden/video-shader.git" + $submoduleUrl = "https://aiden:${env:GITEA_PAT}@git.f-40.com/aiden/video-io-3rdParty.git" + + git init . + git lfs install --local + git remote add origin "$repoUrl" + git fetch --depth=1 origin "${{ gitea.ref }}" + git checkout FETCH_HEAD + + git lfs pull origin "${{ gitea.ref }}" + git submodule sync --recursive + git config submodule.video-io-3rdParty.url "$submoduleUrl" + git submodule update --init --recursive --depth=1 + git -C video-io-3rdParty lfs pull + + Write-Host "Parent LFS files:" + git lfs ls-files + Write-Host "Submodule LFS files:" + git -C video-io-3rdParty lfs ls-files - name: Verify Visual Studio ATL shell: powershell @@ -34,29 +56,73 @@ jobs: - name: Configure Debug shell: powershell run: | + $thirdPartyRoot = "${{ vars.THIRD_PARTY_ROOT }}" + if ([string]::IsNullOrWhiteSpace($thirdPartyRoot)) { + $thirdPartyRoot = $env:THIRD_PARTY_ROOT + } + if ([string]::IsNullOrWhiteSpace($thirdPartyRoot)) { + $thirdPartyRoot = Join-Path $PWD "video-io-3rdParty" + } + if (-not (Test-Path -LiteralPath $thirdPartyRoot)) { + $thirdPartyRoot = Join-Path $PWD "3rdParty" + } + $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" + $slangRoot = Join-Path $thirdPartyRoot "slang-2026.8-windows-x86_64" + } + + $msdfAtlasGenRoot = "${{ vars.MSDF_ATLAS_GEN_ROOT }}" + if ([string]::IsNullOrWhiteSpace($msdfAtlasGenRoot)) { + $msdfAtlasGenRoot = $env:MSDF_ATLAS_GEN_ROOT + } + if ([string]::IsNullOrWhiteSpace($msdfAtlasGenRoot)) { + $msdfAtlasGenRoot = Join-Path $thirdPartyRoot "msdf-atlas-gen" + } + + $ndiSdkRoot = "${{ vars.NDI_SDK_ROOT }}" + if ([string]::IsNullOrWhiteSpace($ndiSdkRoot)) { + $ndiSdkRoot = $env:NDI_SDK_ROOT + } + if ([string]::IsNullOrWhiteSpace($ndiSdkRoot)) { + $ndiSdkRoot = Join-Path $thirdPartyRoot "NDI 6 SDK" + } + + $deckLinkSdkRoot = "${{ vars.DECKLINK_SDK_ROOT }}" + if ([string]::IsNullOrWhiteSpace($deckLinkSdkRoot)) { + $deckLinkSdkRoot = $env:DECKLINK_SDK_ROOT + } + if ([string]::IsNullOrWhiteSpace($deckLinkSdkRoot)) { + $deckLinkSdkRoot = Join-Path $thirdPartyRoot "Blackmagic DeckLink SDK 16.0" } $requiredFiles = @( (Join-Path $slangRoot "bin\slangc.exe"), (Join-Path $slangRoot "bin\slang-compiler.dll"), (Join-Path $slangRoot "bin\slang-glslang.dll"), - (Join-Path $slangRoot "LICENSE") + (Join-Path $slangRoot "LICENSE"), + (Join-Path $msdfAtlasGenRoot "msdf-atlas-gen.exe"), + (Join-Path $ndiSdkRoot "Include\Processing.NDI.Lib.h"), + (Join-Path $ndiSdkRoot "Lib\x64\Processing.NDI.Lib.x64.lib"), + (Join-Path $ndiSdkRoot "Bin\x64\Processing.NDI.Lib.x64.dll"), + (Join-Path $deckLinkSdkRoot "Win\include\DeckLinkAPI.idl") ) $missingFiles = @($requiredFiles | Where-Object { -not (Test-Path -LiteralPath $_) }) if ($missingFiles.Count -gt 0) { - Write-Error "Missing native third-party dependencies. Set Gitea repository variable SLANG_ROOT, or pre-populate the repo-local 3rdParty folder on the Windows runner. Missing: $($missingFiles -join ', ')" + Write-Error "Missing native third-party dependencies. Initialize the private video-io-3rdParty submodule, set THIRD_PARTY_ROOT, or configure per-SDK repository variables. Missing: $($missingFiles -join ', ')" exit 1 } + Write-Host "Using THIRD_PARTY_ROOT=$thirdPartyRoot" Write-Host "Using SLANG_ROOT=$slangRoot" - cmake --preset vs2022-x64-debug -DSLANG_ROOT="$slangRoot" + Write-Host "Using MSDF_ATLAS_GEN_ROOT=$msdfAtlasGenRoot" + Write-Host "Using NDI_SDK_ROOT=$ndiSdkRoot" + Write-Host "Using DECKLINK_SDK_ROOT=$deckLinkSdkRoot" + cmake --preset vs2022-x64-debug -DTHIRD_PARTY_ROOT="$thirdPartyRoot" -DSLANG_ROOT="$slangRoot" -DMSDF_ATLAS_GEN_ROOT="$msdfAtlasGenRoot" -DNDI_SDK_ROOT="$ndiSdkRoot" -DDECKLINK_SDK_ROOT="$deckLinkSdkRoot" - name: Build Debug shell: powershell @@ -91,8 +157,30 @@ jobs: - ui-ubuntu steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Manual Checkout With LFS Submodules + shell: powershell + env: + GITEA_PAT: ${{ secrets.TOKEN }} + run: | + $repoUrl = "https://aiden:${env:GITEA_PAT}@git.f-40.com/aiden/video-shader.git" + $submoduleUrl = "https://aiden:${env:GITEA_PAT}@git.f-40.com/aiden/video-io-3rdParty.git" + + git init . + git lfs install --local + git remote add origin "$repoUrl" + git fetch --depth=1 origin "${{ gitea.ref }}" + git checkout FETCH_HEAD + + git lfs pull origin "${{ gitea.ref }}" + git submodule sync --recursive + git config submodule.video-io-3rdParty.url "$submoduleUrl" + git submodule update --init --recursive --depth=1 + git -C video-io-3rdParty lfs pull + + Write-Host "Parent LFS files:" + git lfs ls-files + Write-Host "Submodule LFS files:" + git -C video-io-3rdParty lfs ls-files - name: Verify Visual Studio ATL shell: powershell @@ -114,29 +202,73 @@ jobs: - name: Configure Release shell: powershell run: | + $thirdPartyRoot = "${{ vars.THIRD_PARTY_ROOT }}" + if ([string]::IsNullOrWhiteSpace($thirdPartyRoot)) { + $thirdPartyRoot = $env:THIRD_PARTY_ROOT + } + if ([string]::IsNullOrWhiteSpace($thirdPartyRoot)) { + $thirdPartyRoot = Join-Path $PWD "video-io-3rdParty" + } + if (-not (Test-Path -LiteralPath $thirdPartyRoot)) { + $thirdPartyRoot = Join-Path $PWD "3rdParty" + } + $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" + $slangRoot = Join-Path $thirdPartyRoot "slang-2026.8-windows-x86_64" + } + + $msdfAtlasGenRoot = "${{ vars.MSDF_ATLAS_GEN_ROOT }}" + if ([string]::IsNullOrWhiteSpace($msdfAtlasGenRoot)) { + $msdfAtlasGenRoot = $env:MSDF_ATLAS_GEN_ROOT + } + if ([string]::IsNullOrWhiteSpace($msdfAtlasGenRoot)) { + $msdfAtlasGenRoot = Join-Path $thirdPartyRoot "msdf-atlas-gen" + } + + $ndiSdkRoot = "${{ vars.NDI_SDK_ROOT }}" + if ([string]::IsNullOrWhiteSpace($ndiSdkRoot)) { + $ndiSdkRoot = $env:NDI_SDK_ROOT + } + if ([string]::IsNullOrWhiteSpace($ndiSdkRoot)) { + $ndiSdkRoot = Join-Path $thirdPartyRoot "NDI 6 SDK" + } + + $deckLinkSdkRoot = "${{ vars.DECKLINK_SDK_ROOT }}" + if ([string]::IsNullOrWhiteSpace($deckLinkSdkRoot)) { + $deckLinkSdkRoot = $env:DECKLINK_SDK_ROOT + } + if ([string]::IsNullOrWhiteSpace($deckLinkSdkRoot)) { + $deckLinkSdkRoot = Join-Path $thirdPartyRoot "Blackmagic DeckLink SDK 16.0" } $requiredFiles = @( (Join-Path $slangRoot "bin\slangc.exe"), (Join-Path $slangRoot "bin\slang-compiler.dll"), (Join-Path $slangRoot "bin\slang-glslang.dll"), - (Join-Path $slangRoot "LICENSE") + (Join-Path $slangRoot "LICENSE"), + (Join-Path $msdfAtlasGenRoot "msdf-atlas-gen.exe"), + (Join-Path $ndiSdkRoot "Include\Processing.NDI.Lib.h"), + (Join-Path $ndiSdkRoot "Lib\x64\Processing.NDI.Lib.x64.lib"), + (Join-Path $ndiSdkRoot "Bin\x64\Processing.NDI.Lib.x64.dll"), + (Join-Path $deckLinkSdkRoot "Win\include\DeckLinkAPI.idl") ) $missingFiles = @($requiredFiles | Where-Object { -not (Test-Path -LiteralPath $_) }) if ($missingFiles.Count -gt 0) { - Write-Error "Missing native third-party dependencies. Set Gitea repository variable SLANG_ROOT, or pre-populate the repo-local 3rdParty folder on the Windows runner. Missing: $($missingFiles -join ', ')" + Write-Error "Missing native third-party dependencies. Initialize the private video-io-3rdParty submodule, set THIRD_PARTY_ROOT, or configure per-SDK repository variables. Missing: $($missingFiles -join ', ')" exit 1 } + Write-Host "Using THIRD_PARTY_ROOT=$thirdPartyRoot" Write-Host "Using SLANG_ROOT=$slangRoot" - cmake --preset vs2022-x64-release -DSLANG_ROOT="$slangRoot" + Write-Host "Using MSDF_ATLAS_GEN_ROOT=$msdfAtlasGenRoot" + Write-Host "Using NDI_SDK_ROOT=$ndiSdkRoot" + Write-Host "Using DECKLINK_SDK_ROOT=$deckLinkSdkRoot" + cmake --preset vs2022-x64-release -DTHIRD_PARTY_ROOT="$thirdPartyRoot" -DSLANG_ROOT="$slangRoot" -DMSDF_ATLAS_GEN_ROOT="$msdfAtlasGenRoot" -DNDI_SDK_ROOT="$ndiSdkRoot" -DDECKLINK_SDK_ROOT="$deckLinkSdkRoot" - name: Build Release shell: powershell