about summary refs log tree commit homepage
path: root/ci/run.sh
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-09-09 12:01:37 +0000
committerEric Wong <e@80x24.org>2023-09-09 21:31:55 +0000
commit21cfa156dc24ba13df6a3fd8d06880a759f23cac (patch)
tree6bdd6f04b83db972cf2c6ce2fd4d942d47b19325 /ci/run.sh
parent0ca202556c6ffc4f4fb8acd17d0854fdc0b0a2df (diff)
downloadpublic-inbox-21cfa156dc24ba13df6a3fd8d06880a759f23cac.tar.gz
Parallezing BUILD_JOBS is usually harmless, but TEST_JOBS can
be problematic when tracking down problems on new platforms.
TEST_TARGET can be `check' or `check-run' for performance.
Diffstat (limited to 'ci/run.sh')
-rwxr-xr-xci/run.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/ci/run.sh b/ci/run.sh
index 9613943b..1faf92c2 100755
--- a/ci/run.sh
+++ b/ci/run.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 set -e
 SUDO=${SUDO-'sudo'} PERL=${PERL-'perl'} MAKE=${MAKE-'make'}
@@ -8,14 +8,16 @@ DO=${DO-''}
 set -x
 if test -f Makefile
 then
-        $DO $MAKE clean
+        $DO $MAKE clean >/dev/null
 fi
+NPROC=${NPROC-$({ getconf _NPROCESSORS_ONLN || getconf NPROCESSORS_ONLN ||
+        gnproc || nproc || echo 2; } 2>/dev/null)}
 
 ./ci/profiles.sh | while read args
 do
         $DO $SUDO $PERL -w ci/deps.perl $args
         $DO $PERL Makefile.PL
-        $DO $MAKE
-        $DO $MAKE check
-        $DO $MAKE clean
+        $DO $MAKE -j${BUILD_JOBS-$NPROC}
+        $DO $MAKE -j${TEST_JOBS-1} ${TEST_TARGET-test}
+        $DO $MAKE clean >/dev/null
 done