diff mbox series

[ovs-dev,v5,01/12] ci: Add JOBS variable to replace all the '-j4' instances.

Message ID 170298963031.1693084.13737971547550864055.stgit@ebuild
State Accepted
Commit ee93f364b91f22f2c1b947c3e6a5799f7e5ddcb6
Delegated to: Eelco Chaudron
Headers show
Series ci: Add remaining check tests to GitHub actions. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Eelco Chaudron Dec. 19, 2023, 12:40 p.m. UTC
Add a JOBS variable, which defaults to '-j4' but can be overwritten
with the same environment variable. This can be useful if you use
this linux-build.sh script outside of GitHub actions on a machine
with many cores.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Simon Horman <horms@ovn.org>
---
 .ci/linux-build.sh |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index aa2ecc505..67c01a644 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -6,6 +6,7 @@  set -x
 CFLAGS_FOR_OVS="-g -O2"
 SPARSE_FLAGS=""
 EXTRA_OPTS="--enable-Werror"
+JOBS=${JOBS:-"-j4"}
 
 function install_dpdk()
 {
@@ -46,7 +47,7 @@  function build_ovs()
     configure_ovs $OPTS
     make selinux-policy
 
-    make -j4
+    make ${JOBS}
 }
 
 if [ "$DEB_PACKAGE" ]; then
@@ -122,8 +123,8 @@  if [ "$TESTSUITE" = 'test' ]; then
     configure_ovs
 
     export DISTCHECK_CONFIGURE_FLAGS="$OPTS"
-    make distcheck -j4 CFLAGS="${CFLAGS_FOR_OVS}" \
-        TESTSUITEFLAGS=-j4 RECHECK=yes
+    make distcheck ${JOBS} CFLAGS="${CFLAGS_FOR_OVS}" \
+        TESTSUITEFLAGS=${JOBS} RECHECK=yes
 else
     build_ovs
     for testsuite in $TESTSUITE; do
@@ -134,7 +135,7 @@  else
             export DPDK_EAL_OPTIONS="--lcores 0@1,1@1,2@1"
             run_as_root="sudo -E PATH=$PATH"
         fi
-        $run_as_root make $testsuite TESTSUITEFLAGS=-j4 RECHECK=yes
+        $run_as_root make $testsuite TESTSUITEFLAGS=${JOBS} RECHECK=yes
     done
 fi