fix: Update Catch2 to 3.12 and fix StringMaker issues #538
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: C/C++ CI | |
| on: [push] | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| # Use a recent stable vcpkg baseline from official Microsoft repo | |
| VCPKG_COMMIT: de46587b4beaa638743916fe5674825cecfb48b3 | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| MH_STUFF_COMPILE_LIBRARY: [true, false] | |
| compiler: | |
| # Modern compilers available on ubuntu-latest (Ubuntu 22.04/24.04) | |
| - exe: g++-12 | |
| deps: g++-12 | |
| - exe: g++-13 | |
| deps: g++-13 | |
| - exe: clang++-14 | |
| deps: clang-14 libc++-14-dev libc++abi-14-dev | |
| - exe: clang++-15 | |
| deps: clang-15 libc++-15-dev libc++abi-15-dev | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }} | |
| - name: Install compilers and tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ${{ matrix.compiler.deps }} ninja-build | |
| pip3 install gcovr | |
| echo "Ensuring programs work..." | |
| ${{ matrix.compiler.exe }} --version | |
| ninja --version | |
| gcovr --version | |
| # - name: Run tests | |
| # working-directory: ./test | |
| # run: make -j`grep -c ^processor /proc/cpuinfo` ${{ matrix.compiler }}_test_output.txt | |
| - name: Build | |
| env: | |
| CXX: ${{ matrix.compiler.exe }} | |
| CXXFLAGS: -Wall -Wpedantic -Wextra -Werror | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake --version | |
| cmake -G Ninja \ | |
| -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" \ | |
| -DMH_STUFF_COMPILE_LIBRARY=${{ matrix.MH_STUFF_COMPILE_LIBRARY }} \ | |
| ../ | |
| cmake --build . | |
| - name: Run tests | |
| env: | |
| CXX: ${{ matrix.compiler.exe }} | |
| run: | | |
| cd build | |
| ctest --version | |
| ctest --output-on-failure | |
| gcovr --version | |
| gcovr --root "../" --exclude ".*/catch.hpp" --exclude ".*/test_compile_file/.*" --exclude ".*/test/.*" --sort-percentage --html-details "results_${{ matrix.compiler.exe }}.html" . | |
| - name: Save test results | |
| if: ${{ matrix.MH_STUFF_COMPILE_LIBRARY }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gcovr_results_${{ matrix.compiler.exe }} | |
| path: build/results*.html | |
| # build-windows: | |
| # runs-on: windows-latest | |
| # strategy: | |
| # fail-fast: false | |
| # matrix: | |
| # MH_STUFF_COMPILE_LIBRARY: [true, false] | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # - uses: lukka/run-vcpkg@v11 | |
| # with: | |
| # vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }} | |
| # - uses: seanmiddleditch/gha-setup-ninja@v5 | |
| # - name: Setup compiler paths | |
| # uses: ilammy/msvc-dev-cmd@v1 | |
| # - name: Build | |
| # run: | | |
| # mkdir build | |
| # cd build | |
| # cmake -G Ninja \ | |
| # -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" \ | |
| # -DMH_STUFF_COMPILE_LIBRARY=${{ matrix.MH_STUFF_COMPILE_LIBRARY }} \ | |
| # ../ | |
| # cmake --build . | |
| # - name: Run tests | |
| # run: | | |
| # cd build | |
| # ctest --output-on-failure | |
| # registry-update: | |
| # needs: [build-linux] | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: PazerOP/vcpkg-registry-update@HEAD | |
| # with: | |
| # port-name: mh-stuff | |
| # workflow-pat: ${{ secrets.WORKFLOW_PAT }} | |
| all-checks-passed: | |
| if: always() | |
| needs: [build-linux] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Verify all checks passed | |
| run: | | |
| if [[ "${{ needs.build-linux.result }}" != "success" ]]; then | |
| echo "build-linux failed: ${{ needs.build-linux.result }}" | |
| exit 1 | |
| fi | |
| echo "All checks passed!" |