chore: add CI workflow with cmake presets #1
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: ["master"] | |
| pull_request: | |
| branches: ["master"] | |
| jobs: | |
| test: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Windows · MSVC x64 | |
| os: windows-latest | |
| preset: msvc-x64 | |
| vcpkg_triplet: x64-windows | |
| - name: Windows · Clang-CL x64 | |
| os: windows-latest | |
| preset: llvm-x64 | |
| vcpkg_triplet: x64-windows | |
| - name: Windows · MinGW x64 | |
| os: windows-latest | |
| preset: gcc-mingw-x64 | |
| vcpkg_triplet: x64-mingw-dynamic | |
| - name: Windows ARM64 · MSVC | |
| os: windows-11-arm | |
| preset: msvc-arm64 | |
| vcpkg_triplet: arm64-windows | |
| - name: Linux · GCC x64 | |
| os: ubuntu-latest | |
| preset: gcc-linux-x64 | |
| vcpkg_triplet: x64-linux-dynamic | |
| - name: Linux · Clang x64 | |
| os: ubuntu-latest | |
| preset: clang-linux-x64 | |
| vcpkg_triplet: x64-linux-dynamic | |
| - name: Linux ARM64 · GCC | |
| os: ubuntu-24.04-arm | |
| preset: gcc-linux-arm64 | |
| vcpkg_triplet: arm64-linux | |
| - name: macOS ARM64 · Apple Clang | |
| os: macos-latest | |
| preset: apple-clang-macos-arm64 | |
| vcpkg_triplet: arm64-osx | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set VCPKG_ROOT | |
| shell: bash | |
| run: echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV | |
| - name: Add MinGW to PATH | |
| if: matrix.preset == 'gcc-mingw-x64' | |
| shell: bash | |
| run: echo "C:/msys64/mingw64/bin" >> $GITHUB_PATH | |
| - name: Install GTest | |
| run: vcpkg install gtest:${{ matrix.vcpkg_triplet }} | |
| - name: Configure | |
| working-directory: tests/unittest | |
| run: cmake --preset ${{ matrix.preset }} | |
| - name: Build | |
| working-directory: tests/unittest | |
| run: cmake --build --preset ${{ matrix.preset }} | |
| - name: Test | |
| working-directory: tests/unittest/build/${{ matrix.preset }} | |
| run: ctest --build-config Release --output-on-failure |