From 5634284682f7e88d886746585e101694270be6ed Mon Sep 17 00:00:00 2001 From: Alexander Hans Date: Sat, 28 Nov 2026 22:03:53 +0100 Subject: [PATCH 1/4] build(ci): add --parallel to CMake invocation --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aedf07f7..add79679 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: run: | cmake -G Ninja . cmake --build . -- test_hello-world - cmake --build . + cmake --build . --parallel env: CXX: ${{ matrix.compiler }} @@ -47,7 +47,7 @@ jobs: run: | cmake -G Ninja . cmake --build . -- test_hello-world - cmake --build . + cmake --build . --parallel env: CXX: ${{ matrix.compiler }} - name: Run tests without common Catch @@ -55,7 +55,7 @@ jobs: run: | cmake -G Ninja -DEXERCISM_COMMON_CATCH=OFF . cmake --build . -- test_hello-world - cmake --build . + cmake --build . --parallel env: CXX: ${{ matrix.compiler }} @@ -73,7 +73,7 @@ jobs: rm exercises/practice/meetup -r cmake . cmake --build . -- test_hello-world - cmake --build . + cmake --build . --parallel mac: name: MacOS @@ -87,7 +87,7 @@ jobs: run: | cmake . cmake --build . -- test_hello-world - cmake --build . + cmake --build . --parallel tests: name: Tests From 7c9d55bef3b6b4d66f52f625b42417f9baa7a4f1 Mon Sep 17 00:00:00 2001 From: Alexander Hans Date: Sat, 28 Nov 2026 23:09:41 +0100 Subject: [PATCH 2/4] Retrigger CI From 00ac049a994d2e3b7ad3a92facb3f9fb732ec00d Mon Sep 17 00:00:00 2001 From: Alexander Hans Date: Sun, 29 Nov 2026 10:13:17 +0100 Subject: [PATCH 3/4] wip --- .github/workflows/ci.yml | 123 +++++++++++++++++---------------------- 1 file changed, 53 insertions(+), 70 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index add79679..4762b8c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,101 +8,84 @@ on: branches: - main -jobs: - linux-min: - name: Linux Min Config - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: [clang++-15, g++-12] - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - - name: Install Dependencies - # Boost must be installed only because the CMake version (3.12) can't - # detect the installed Boost version (1.69) - run: sudo apt-get update && sudo apt-get -y install ninja-build libboost-date-time-dev g++-multilib - - name: Run tests with common Catch - run: | - cmake -G Ninja . - cmake --build . -- test_hello-world - cmake --build . --parallel - env: - CXX: ${{ matrix.compiler }} +# A new push to a PR cancels that PR's run still in progress. +# Runs on main are left to finish, so every commit there gets a full result. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} - linux-latest: - name: Linux Latest Config - needs: [linux-min] - runs-on: ubuntu-26.04 +jobs: + build: + # Setting the name from the matrix keeps the check names that + # .github/required-checks.yml lists, such as "Windows" and "MacOS". + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} strategy: + # The configurations are one matrix so that the first failure cancels the rest. + fail-fast: true matrix: - compiler: [clang++, g++] + include: + - name: Linux Min Config (clang++-15) + os: ubuntu-22.04 + compiler: clang++-15 + packages: ninja-build libboost-date-time-dev g++-multilib + cmake-args: -G Ninja + - name: Linux Min Config (g++-12) + os: ubuntu-22.04 + compiler: g++-12 + packages: ninja-build libboost-date-time-dev g++-multilib + cmake-args: -G Ninja + - name: Linux Latest Config (clang++) + os: ubuntu-26.04 + compiler: clang++ + packages: ninja-build libboost-date-time-dev + cmake-args: -G Ninja -DEXERCISM_COMMON_CATCH=OFF + - name: Linux Latest Config (g++) + os: ubuntu-26.04 + compiler: g++ + packages: ninja-build libboost-date-time-dev + cmake-args: -G Ninja + - name: Windows + os: windows-2022 + - name: MacOS + os: macOS-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Install Dependencies + if: runner.os == 'Linux' # Boost must be installed only because the CMake version (3.12) can't # detect the installed Boost version (1.69) - run: sudo apt-get update && sudo apt-get -y install ninja-build libboost-date-time-dev - - name: Run tests with common Catch - if: matrix.compiler == 'g++' - run: | - cmake -G Ninja . - cmake --build . -- test_hello-world - cmake --build . --parallel - env: - CXX: ${{ matrix.compiler }} - - name: Run tests without common Catch - if: matrix.compiler == 'clang++' - run: | - cmake -G Ninja -DEXERCISM_COMMON_CATCH=OFF . - cmake --build . -- test_hello-world - cmake --build . --parallel - env: - CXX: ${{ matrix.compiler }} - - windows: - name: Windows - needs: [linux-min] - runs-on: windows-2022 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - - name: Run Tests + run: sudo apt-get update && sudo apt-get -y install ${{ matrix.packages }} + - name: Install Boost + if: runner.os == 'macOS' + run: brew install boost + - name: Remove exercises that need Boost + if: runner.os == 'Windows' shell: powershell # Delete the exercises that require Boost to avoid issues with Windows setup. run: | rm exercises/practice/gigasecond -r rm exercises/practice/meetup -r - cmake . - cmake --build . -- test_hello-world - cmake --build . --parallel - - mac: - name: MacOS - needs: [linux-min] - runs-on: macOS-latest - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - - name: Install Boost - run: brew install boost - - name: Run Tests + - name: Run tests + shell: bash run: | - cmake . + cmake ${{ matrix.cmake-args }} . cmake --build . -- test_hello-world cmake --build . --parallel + env: + CXX: ${{ matrix.compiler }} tests: name: Tests - needs: [linux-min, linux-latest, windows, mac] + needs: [build] if: always() runs-on: ubuntu-26.04 steps: - name: Check that every configuration passed env: - LINUX_MIN_RESULT: ${{ needs.linux-min.result }} - LINUX_LATEST_RESULT: ${{ needs.linux-latest.result }} - WINDOWS_RESULT: ${{ needs.windows.result }} - MAC_RESULT: ${{ needs.mac.result }} + BUILD_RESULT: ${{ needs.build.result }} run: | - if [[ "$LINUX_MIN_RESULT" != "success" || "$LINUX_LATEST_RESULT" != "success" || "$WINDOWS_RESULT" != "success" || "$MAC_RESULT" != "success" ]]; then + if [[ "$BUILD_RESULT" != "success" ]]; then echo "The exercise tests failed on at least one configuration." exit 1 fi From b4778a98a5d0ba13e4e668dd1658209439408a1d Mon Sep 17 00:00:00 2001 From: Alexander Hans Date: Sun, 29 Nov 2026 10:17:21 +0100 Subject: [PATCH 4/4] fix Windows --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4762b8c8..e8b9ecb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: shell: bash run: | cmake ${{ matrix.cmake-args }} . - cmake --build . -- test_hello-world + cmake --build . --target test_hello-world cmake --build . --parallel env: CXX: ${{ matrix.compiler }}