From 9f4cbe599b2d61a808ae884ac01c5f20b8bbadb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 4 May 2025 20:14:59 +0200 Subject: [PATCH] ci: add variable JOBS in script build_test.sh --- .github/workflows/ci.yml | 1 + tools/build_test.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58f14a67f..5ee1b25a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -433,6 +433,7 @@ jobs: CC: ${{ matrix.config.cc }} CXX: ${{ matrix.config.cxx }} RUN_TESTS: "0" + JOBS: "2" run: ./tools/build_test.sh ${{ matrix.config.buildargs }} - name: Run WeeChat diff --git a/tools/build_test.sh b/tools/build_test.sh index 0b50584ec..864b8e90f 100755 --- a/tools/build_test.sh +++ b/tools/build_test.sh @@ -22,10 +22,11 @@ # # Build WeeChat according to environment variables: +# - JOBS: number of parallel jobs # - RUN_TESTS: set to 0 to disable run of tests # # Syntax to run the script with environment variables: -# RUN_TESTS=0 ./build_test.sh +# RUN_TESTS=0 JOBS=2 ./build_test.sh # # Syntax to run the script with arguments on command line: # ./build_test.sh [arguments] @@ -44,12 +45,16 @@ build_dir="build-tmp-$$" mkdir "${build_dir}" cd "${build_dir}" +if [ -z "${JOBS}" ]; then + JOBS="$(nproc)" +fi + cmake .. "$@" if [ -f "build.ninja" ]; then ninja -v sudo ninja install else - make VERBOSE=1 -j "$(nproc)" + make VERBOSE=1 -j "${JOBS}" sudo make install fi if [ "$RUN_TESTS" != "0" ]; then