Skip to content

feat(pattern): add operator sugar for combinators (#50) #444

feat(pattern): add operator sugar for combinators (#50)

feat(pattern): add operator sugar for combinators (#50) #444

Workflow file for this run

name: CI (Full Matrix)
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
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 =====
# Pinned to windows-2022: the windows-2025-vs2026 image bundles
# Clang 22, which cmake < 4.2 cannot configure ("no known features
# for CXX compiler Clang"). windows-2022 pairs VS2022 with a
# cmake that still understands its clang-cl.
- os: windows-2022
compiler: clang-cl
std: 20
- os: windows-2022
compiler: clang-cl
std: 23
- os: windows-2022
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: |
# windows-latest moved to windows-2025-vs2026, which ships only
# Visual Studio 2026 (generator "Visual Studio 18 2026"); the old
# VS 17 2022 instance no longer exists on the image.
$generator = if (& cmake --version | Select-String "4\.") {
"Visual Studio 18 2026"
} else {
"Visual Studio 17 2022"
}
if ("${{ matrix.compiler }}" -eq "msvc") {
cmake -S . -B build -G "$generator" -A x64 `
-DCMAKE_CXX_STANDARD=${{ matrix.std }} `
-DPTN_BUILD_TESTS=ON `
-DPTN_BUILD_BENCHMARKS=OFF `
-DPTN_SKIP_COMPILER_CHECK=ON
} else {
cmake -S . -B build -G "$generator" -A x64 -T ClangCL `
-DCMAKE_CXX_STANDARD=${{ matrix.std }} `
-DPTN_BUILD_TESTS=ON `
-DPTN_BUILD_BENCHMARKS=OFF `
-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 }} \
-DPTN_BUILD_TESTS=ON \
-DPTN_BUILD_BENCHMARKS=OFF \
-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 -C Release --output-on-failure
- name: Upload test log (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-log-${{ matrix.os }}-${{ matrix.compiler }}-cxx${{ matrix.std }}
path: build/Testing/Temporary/LastTest.log