From 023814cedca4ef4953efad641a2cdc24326116dc Mon Sep 17 00:00:00 2001 From: stertooy <5571903+stertooy@users.noreply.github.com> Date: Fri, 27 Mar 2026 21:56:43 +0100 Subject: [PATCH] macOS alternative for nproc --- action.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 886e0b3..0feab40 100644 --- a/action.yml +++ b/action.yml @@ -7,6 +7,13 @@ runs: - name: "Build io and profiling packages if necessary" shell: bash run: | + # macOS compatibility for nproc + if [[ "${{ runner.os }}" = "macOS" ]] ; then + NPROC=$(sysctl -n hw.ncpu) + else + NPROC=$(nproc) + fi + # the following somewhat awkward `cd` invocation ensures # compatibility with both GAP <= 4.11 (with package dir names like # `pkg/io-1.2.3`) and GAP >= 4.12 (where it is `pkg/io`) @@ -14,7 +21,7 @@ runs: if [[ ! -f config.status ]] ; then ./configure --with-gaproot=$GAPROOT fi - make -j$(nproc) + make -j${NPROC} cd $GAPROOT/pkg/profiling || cd $GAPROOT/pkg/profiling-* if [[ ! -f Makefile ]] ; then @@ -24,7 +31,7 @@ runs: ./configure $GAPROOT fi fi - make -j$(nproc) + make -j${NPROC} - name: "Process coverage data" shell: bash