From b65c89c159aeb87cf5c0f66894e862473a688b7b Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Thu, 17 Feb 2022 00:10:04 -0500 Subject: [PATCH] Use at least 2 cores --- .github/scripts/unix.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/scripts/unix.sh b/.github/scripts/unix.sh index d890577b6..c2ecad735 100644 --- a/.github/scripts/unix.sh +++ b/.github/scripts/unix.sh @@ -95,7 +95,11 @@ function build () configure if [ "$(uname)" == "Linux" ]; then - make -j$(nproc) + if (($(nproc) > 2)); then + make -j$(nproc) + else + make -j2 + fi elif [ "$(uname)" == "Darwin" ]; then make -j$(sysctl -n hw.physicalcpu) fi @@ -113,7 +117,11 @@ function test () # Actual testing if [ "$(uname)" == "Linux" ]; then - make -j$(nproc) check + if (($(nproc) > 2)); then + make -j$(nproc) check + else + make -j2 check + fi elif [ "$(uname)" == "Darwin" ]; then make -j$(sysctl -n hw.physicalcpu) check fi