Skip to content

some improvements

some improvements #58

Workflow file for this run

name: Build Spectrum
on:
push:
pull_request:
jobs:
build:
runs-on: windows-2025-vs2026
strategy:
matrix:
configuration: [Debug-D3D12, Debug-Vulkan]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore vcpkg installed packages
id: vcpkg-cache
uses: actions/cache/restore@v4
with:
path: ./vcpkg_installed
key: vcpkg-v2-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }}
restore-keys: |
vcpkg-v2-${{ runner.os }}-
- name: Setup project
shell: cmd
run: setup.bat
- name: Generate Visual Studio projects
shell: cmd
run: generate_project.bat
- name: Install vcpkg dependencies
shell: cmd
run: vcpkg install --triplet x64-windows --x-install-root ./vcpkg_installed/x64-windows
- name: Save vcpkg installed packages
if: steps.vcpkg-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ./vcpkg_installed
key: vcpkg-v2-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }}
- name: Integrate vcpkg with MSBuild
shell: cmd
run: vcpkg integrate install
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Debug vcpkg installed dir
shell: powershell
run: |
msbuild ./projects/modules/modules.vcxproj `
/p:Configuration="${{ matrix.configuration }}" /p:Platform=x64 `
/pp:preprocessed.xml
Select-String "_ZVcpkgCurrentInstalledDir" preprocessed.xml | Select-Object -First 5
- name: Build solution
run: msbuild ./projects/spectrum.sln /p:Configuration="${{ matrix.configuration }}" /p:Platform=x64 /m /v:minimal
- name: Upload build output
uses: actions/upload-artifact@v4
if: always()
with:
name: build-${{ matrix.configuration }}
path: ./bin/Debug/
retention-days: 1
test:
runs-on: windows-2025-vs2026
needs: build
strategy:
matrix:
configuration: [Debug-D3D12, Debug-Vulkan]
steps:
- name: Download build output
uses: actions/download-artifact@v4
with:
name: build-${{ matrix.configuration }}
path: ./bin/Debug
- name: Run tests
shell: powershell
working-directory: ./bin/Debug
run: |
& ".\test.exe"
if ($LASTEXITCODE -ne 0) {
Write-Error "Tests failed with exit code $LASTEXITCODE"
exit $LASTEXITCODE
}
Write-Host "All tests passed!"