Repository navigation
Update README.md #61
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 (Full Matrix) | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| name: "${{ matrix.compiler }} C++${{ matrix.std }}" | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # ===== GCC ===== | |
| - os: ubuntu-latest | |
| compiler: gcc-11 | |
| cxx: g++-11 | |
| std: 17 | |
| - os: ubuntu-latest | |
| compiler: gcc-11 | |
| cxx: g++-11 | |
| std: 20 | |
| - os: ubuntu-latest | |
| compiler: gcc-13 | |
| cxx: g++-13 | |
| std: 23 | |
| - os: ubuntu-latest | |
| compiler: gcc-13 | |
| cxx: g++-13 | |
| std: 26 | |
| # ===== Clang ===== | |
| - os: ubuntu-latest | |
| compiler: clang-14 | |
| cxx: clang++-14 | |
| std: 17 | |
| - os: ubuntu-latest | |
| compiler: clang-16 | |
| cxx: clang++-16 | |
| std: 20 | |
| - os: ubuntu-latest | |
| compiler: clang-18 | |
| cxx: clang++-18 | |
| std: 23 | |
| - os: ubuntu-latest | |
| compiler: clang-18 | |
| cxx: clang++-18 | |
| std: 26 | |
| # ===== Windows: MSVC ===== | |
| - os: windows-latest | |
| compiler: msvc | |
| std: 20 | |
| - os: windows-latest | |
| compiler: msvc | |
| std: 23 | |
| - os: windows-latest | |
| compiler: msvc | |
| std: 26 | |
| # ===== Windows: clang-cl ===== | |
| - os: windows-latest | |
| compiler: clang-cl | |
| std: 20 | |
| - os: windows-latest | |
| compiler: clang-cl | |
| std: 23 | |
| - os: windows-latest | |
| compiler: clang-cl | |
| std: 26 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Linux: install compilers | |
| - name: Setup Compiler (Linux) | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| if [[ "${{ matrix.compiler }}" == gcc* ]]; then | |
| ver=$(echo "${{ matrix.compiler }}" | cut -d'-' -f2) | |
| sudo apt-get install -y gcc-${ver} g++-${ver} | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${ver} 100 | |
| elif [[ "${{ matrix.compiler }}" == clang* ]]; then | |
| ver=$(echo "${{ matrix.compiler }}" | cut -d'-' -f2) | |
| sudo apt-get install -y clang-${ver} | |
| sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${ver} 100 | |
| fi | |
| # Windows: detect MSVC vs clang-cl | |
| - name: Configure CMake (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| if ("${{ matrix.compiler }}" -eq "msvc") { | |
| cmake -S . -B build -G "Visual Studio 17 2022" -A x64 ` | |
| -DCMAKE_CXX_STANDARD=${{ matrix.std }} ` | |
| -DBUILD_TESTS=ON ` | |
| -DPTN_SKIP_COMPILER_CHECK=ON | |
| } else { | |
| cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -T ClangCL ` | |
| -DCMAKE_CXX_STANDARD=${{ matrix.std }} ` | |
| -DBUILD_TESTS=ON ` | |
| -DPTN_SKIP_COMPILER_CHECK=ON | |
| } | |
| # Linux: configure | |
| - name: Configure CMake (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| cmake -S . -B build \ | |
| -DCMAKE_CXX_STANDARD=${{ matrix.std }} \ | |
| -DBUILD_TESTS=ON \ | |
| -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \ | |
| -DPTN_SKIP_COMPILER_CHECK=ON | |
| - name: Build | |
| run: cmake --build build --config Release --parallel | |
| - name: Run tests | |
| run: ctest --test-dir build --output-on-failure |