Test #390
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: Test | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - dev | |
| pull_request: | |
| branches: | |
| - master | |
| release: | |
| types: | |
| - published | |
| schedule: | |
| - cron: "0 0 * * 1" # Runs every Monday at midnight UTC | |
| env: | |
| BUILD_TYPE: Debug | |
| jobs: | |
| test: | |
| permissions: | |
| actions: read | |
| contents: read | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Ubuntu GCC | |
| os: ubuntu-24.04 | |
| compiler: gcc-13 | |
| compilercxx: g++-13 | |
| cflags: "-fsanitize=address,leak,undefined" | |
| cxxflags: "-fsanitize=address,leak,undefined" | |
| multiline-separator: \ | |
| - name: Ubuntu Clang | |
| os: ubuntu-24.04 | |
| compiler: clang | |
| compilercxx: clang++ | |
| cflags: "-fsanitize=address,leak,undefined" | |
| cxxflags: "-fsanitize=address,leak,undefined" | |
| multiline-separator: \ | |
| - name: Windows MSVC | |
| os: windows-latest | |
| compiler: msvc | |
| compilercxx: msvc | |
| cflags: "" | |
| cxxflags: "" | |
| multiline-separator: "`" | |
| - name: MacOS ARM AppleClang | |
| os: macos-latest | |
| compiler: clang | |
| compilercxx: clang++ | |
| cflags: "" | |
| cxxflags: "" | |
| multiline-separator: \ | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| fetch-depth: 0 | |
| # Further brew packages needed to run/install vcpkg dependencies | |
| - name: Setup MacOS dependencies | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew install ninja | |
| brew install autoconf | |
| brew install libtool | |
| brew install automake | |
| - name: Restore vcpkg cache | |
| id: vcpkg-cache | |
| uses: TAServers/vcpkg-cache@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| prefix: vcpkg-test/ | |
| - name: Configure CMake ${{ matrix.os }}-${{ matrix.compilercxx }} | |
| env: | |
| VCPKG_FEATURE_FLAGS: "binarycaching" # Possibly redundant, but explicitly sets the binary caching feature flag | |
| VCPKG_BINARY_SOURCES: "clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite" | |
| CC: ${{ matrix.compiler }} | |
| CXX: ${{ matrix.compilercxx }} | |
| CFLAGS: ${{ matrix.cflags }} | |
| CXXFLAGS: ${{ matrix.cxxflags }} | |
| run: | | |
| cmake -B ${{github.workspace}}/build ${{ matrix.multiline-separator}} | |
| -DCMAKE_OSX_ARCHITECTURES="arm64" ${{ matrix.multiline-separator}} | |
| -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{ matrix.multiline-separator}} | |
| -DPSAPI_BUILD_DOCS=OFF ${{ matrix.multiline-separator}} | |
| -DPSAPI_BUILD_BENCHMARKS=OFF ${{ matrix.multiline-separator}} | |
| -DPSAPI_BUILD_EXAMPLES=OFF ${{ matrix.multiline-separator}} | |
| -DPSAPI_BUILD_PYTHON=OFF ${{ matrix.multiline-separator}} | |
| - name: Build ${{ matrix.os }}-${{ matrix.compilercxx }} | |
| env: | |
| CC: ${{ matrix.compiler }} | |
| CXX: ${{ matrix.compilercxx }} | |
| CFLAGS: ${{ matrix.cflags }} | |
| CXXFLAGS: ${{ matrix.cxxflags }} | |
| run: | | |
| cmake --build ${{github.workspace}}/build ${{ matrix.multiline-separator}} | |
| --config ${{env.BUILD_TYPE}} ${{ matrix.multiline-separator}} | |
| --parallel $(getconf _NPROCESSORS_ONLN || sysctl -n hw.ncpu || echo %NUMBER_OF_PROCESSORS%) | |
| # On windows we need to copy the test files differently as it generates sub-folders | |
| # for the copied test files | |
| - name: Copy Testfiles on Windows | |
| if: runner.os == 'Windows' | |
| working-directory: ${{github.workspace}}/build/PhotoshopTest | |
| run: xcopy ".\\${{env.BUILD_TYPE}}\\documents" ".\\documents" /E /I | |
| - name: Test ${{ matrix.os }}-${{ matrix.compilercxx }} | |
| working-directory: ${{github.workspace}}/build/PhotoshopTest | |
| run: ctest -C ${{env.BUILD_TYPE}} --extra-verbose --stop-on-failure --output-on-failure |