From a5f17627c673270e4403cdfad2439e4cbcb05e8d Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 21 Jan 2026 13:25:49 +0100 Subject: [PATCH] Use cross-platform CPU core count in CI On MacOS there is no nproc command so this switches over to an action to determine the core count. --- .github/workflows/ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb305c1e..f11d86d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,8 +31,11 @@ jobs: if: runner.os == 'Windows' with: packages: gcc-core gcc-g++ + - name: Get number of CPU cores + uses: SimenB/github-actions-cpu-cores@v2 + id: cpu-cores - name: Build - run: make -j$(nproc) + run: make -j${{ steps.cpu-cores.outputs.count }} shell: bash env: CC: gcc @@ -51,10 +54,13 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 + - name: Get number of CPU cores + uses: SimenB/github-actions-cpu-cores@v2 + id: cpu-cores - name: Build run: | cmake -B build - cmake --build build -j$(nproc) + cmake --build build -j${{ steps.cpu-cores.outputs.count }} # A dummy job that you can mark as a required check instead of each individual test test-suite: