using swiftshader to check against goldens #132
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CMake on multiple platforms | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| build_type: [Release, Debug] | |
| window_backend: [GLFW, SDL3] | |
| gpu_backend: [OpenGL, Vulkan] | |
| c_compiler: [gcc, clang, cl] | |
| include: | |
| - os: windows-latest | |
| c_compiler: cl | |
| cpp_compiler: cl | |
| - os: ubuntu-latest | |
| c_compiler: gcc | |
| cpp_compiler: g++ | |
| - os: ubuntu-latest | |
| c_compiler: clang | |
| cpp_compiler: clang++ | |
| exclude: | |
| - os: windows-latest | |
| c_compiler: gcc | |
| - os: windows-latest | |
| c_compiler: clang | |
| - os: ubuntu-latest | |
| c_compiler: cl | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Linux GLFW dependencies | |
| if: runner.os == 'Linux' && matrix.window_backend == 'GLFW' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev | |
| - name: Install Linux SDL3 dependencies | |
| if: runner.os == 'Linux' && matrix.window_backend == 'SDL3' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libx11-dev libxext-dev libxcursor-dev libxi-dev libxrandr-dev libxss-dev libxtst-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libdbus-1-dev | |
| - name: Install Vulkan SDK | |
| if: matrix.gpu_backend == 'Vulkan' | |
| uses: humbletim/setup-vulkan-sdk@v1.2.1 | |
| with: | |
| vulkan-query-version: 1.4.341.1 | |
| vulkan-components: Vulkan-Headers, Vulkan-Loader, SPIRV-Tools, Glslang | |
| vulkan-use-cache: true | |
| - name: Set reusable strings | |
| id: strings | |
| shell: bash | |
| run: | | |
| echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
| - name: Configure CMake | |
| run: > | |
| cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
| -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | |
| -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
| -DNOTHOFAGUS_WINDOW_BACKEND=${{ matrix.window_backend }} | |
| -DNOTHOFAGUS_BACKEND_VULKAN=${{ matrix.gpu_backend == 'Vulkan' && 'ON' || 'OFF' }} | |
| -DNOTHOFAGUS_USE_GLSLANG=ON | |
| -S ${{ github.workspace }} | |
| - name: Build | |
| run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | |
| - name: Test | |
| working-directory: ${{ steps.strings.outputs.build-output-dir }} | |
| run: ctest --build-config ${{ matrix.build_type }} |