about summary refs log tree commit homepage
path: root/ci/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/run.sh')
-rwxr-xr-xci/run.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/ci/run.sh b/ci/run.sh
index 9613943b..bd1d8a4d 100755
--- a/ci/run.sh
+++ b/ci/run.sh
@@ -1,6 +1,7 @@
 #!/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>
+# Beware, this alters system-wide package installation.
 set -e
 SUDO=${SUDO-'sudo'} PERL=${PERL-'perl'} MAKE=${MAKE-'make'}
 DO=${DO-''}
@@ -8,14 +9,17 @@ 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 ||
+                echo 2; } 2>/dev/null)}
 
-./ci/profiles.sh | while read args
+TEST_JOBS=${TEST_JOBS-1}
+$PERL -w ci/profiles.perl | while read args
 do
-        $DO $SUDO $PERL -w ci/deps.perl $args
+        $DO $SUDO $PERL -w install/deps.perl -y --allow-remove $args
         $DO $PERL Makefile.PL
-        $DO $MAKE
-        $DO $MAKE check
-        $DO $MAKE clean
+        $DO $MAKE -j${BUILD_JOBS-$NPROC}
+        $DO $MAKE ${TEST_TARGET-check} N=${N-$TEST_JOBS}
+        $DO $MAKE clean >/dev/null
 done