From 147a84803fceb90bc8eb52d830eebfdd03c4913e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 26 Feb 2025 21:40:59 +0100 Subject: [PATCH] GHA: tidy up parallel options Replace `--parallel ` and `-j` for individual commands with `MAKEFLAGS`. `MAKEFLAGS` is necessary for autotools jobs and CMake jobs using the default generator. Also: - drop redundant `-j5` for android jobs. - drop redundant `--parallel 5` for MSVC jobs. --- .github/workflows/distcheck.yml | 20 ++++++++------- .github/workflows/non-native.yml | 26 ++++++++++--------- .github/workflows/windows.yml | 44 ++++++++++++++++++-------------- 3 files changed, 50 insertions(+), 40 deletions(-) diff --git a/.github/workflows/distcheck.yml b/.github/workflows/distcheck.yml index 5186c27158..1253b4a87b 100644 --- a/.github/workflows/distcheck.yml +++ b/.github/workflows/distcheck.yml @@ -23,6 +23,8 @@ jobs: maketgz-and-verify-in-tree: runs-on: ubuntu-latest timeout-minutes: 15 + env: + MAKEFLAGS: -j 5 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: @@ -55,9 +57,9 @@ jobs: tar xvf curl-99.98.97.tar.gz pushd curl-99.98.97 ./configure --prefix=$HOME/temp --without-ssl --without-libpsl - make -j5 - make -j5 test-ci - make -j5 install + make + make test-ci + make install popd # basic check of the installed files bash scripts/installcheck.sh $HOME/temp @@ -80,8 +82,8 @@ jobs: mkdir build pushd build ../curl-99.98.97/configure --without-ssl --without-libpsl - make -j5 - make -j5 test-ci + make + make test-ci popd rm -rf build rm -rf curl-99.98.97 @@ -103,9 +105,9 @@ jobs: mkdir build pushd build ../configure --without-ssl --enable-debug "--prefix=${PWD}/pkg" --without-libpsl - make -j5 - make -j5 test-ci - make -j5 install + make + make test-ci + make install verify-out-of-tree-cmake: runs-on: ubuntu-latest @@ -122,7 +124,7 @@ jobs: tar xvf curl-99.98.97.tar.gz pushd curl-99.98.97 cmake -B build -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF - make -C build -j5 + make -C build missing-files: runs-on: ubuntu-latest diff --git a/.github/workflows/non-native.yml b/.github/workflows/non-native.yml index 62c6782bb3..3877577444 100644 --- a/.github/workflows/non-native.yml +++ b/.github/workflows/non-native.yml @@ -490,7 +490,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --verbose else - make -j5 -C bld V=1 + make -C bld V=1 fi - name: 'curl info' @@ -501,7 +501,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --target testdeps else - make -j5 -C bld -C tests + make -C bld -C tests fi - name: 'build examples' @@ -509,7 +509,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --target curl-examples else - make -j5 -C bld examples + make -C bld examples fi amiga: @@ -518,6 +518,7 @@ jobs: timeout-minutes: 5 env: amissl-version: 5.18 + MAKEFLAGS: -j 5 strategy: matrix: build: [autotools, cmake] @@ -584,9 +585,9 @@ jobs: - name: 'build' run: | if [ '${{ matrix.build }}' = 'cmake' ]; then - cmake --build bld --parallel 5 + cmake --build bld else - make -j5 -C bld + make -C bld fi - name: 'curl info' @@ -596,18 +597,18 @@ jobs: if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time run: | if [ '${{ matrix.build }}' = 'cmake' ]; then - cmake --build bld --parallel 5 --target testdeps + cmake --build bld --target testdeps else - make -j5 -C bld -C tests + make -C bld -C tests fi - name: 'build examples' if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time run: | if [ '${{ matrix.build }}' = 'cmake' ]; then - cmake --build bld --parallel 5 --target curl-examples + cmake --build bld --target curl-examples else - make -j5 -C bld examples + make -C bld examples fi msdos: @@ -616,6 +617,7 @@ jobs: timeout-minutes: 5 env: toolchain-version: '3.4' + MAKEFLAGS: -j 5 strategy: matrix: build: [autotools, cmake] @@ -694,7 +696,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld else - make -j5 -C bld + make -C bld fi - name: 'curl info' @@ -706,7 +708,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --target testdeps else - make -j5 -C bld -C tests + make -C bld -C tests fi - name: 'build examples' @@ -715,5 +717,5 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --target curl-examples else - make -j5 -C bld examples + make -C bld examples fi diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 670265146a..66b5745fc7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -45,6 +45,7 @@ jobs: shell: C:\cygwin\bin\bash.exe '{0}' env: SHELLOPTS: 'igncr' + MAKEFLAGS: -j 5 strategy: matrix: include: @@ -113,7 +114,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --config '${{ matrix.type }}' else - make -C bld -j5 V=1 install + make -C bld V=1 install fi - name: 'curl version' @@ -132,7 +133,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --config '${{ matrix.type }}' --target testdeps else - make -C bld -j5 V=1 -C tests + make -C bld V=1 -C tests fi - name: 'run tests' @@ -147,7 +148,7 @@ jobs: PATH="$PWD/bld/lib:$PATH" cmake --build bld --config '${{ matrix.type }}' --target test-ci else - make -C bld -j5 V=1 test-ci + make -C bld V=1 test-ci fi - name: 'build examples' @@ -157,7 +158,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --config '${{ matrix.type }}' --target curl-examples else - make -C bld -j5 V=1 examples + make -C bld V=1 examples fi msys2: # both msys and mingw-w64 @@ -167,6 +168,8 @@ jobs: defaults: run: shell: msys2 {0} + env: + MAKEFLAGS: -j 5 strategy: matrix: include: @@ -288,7 +291,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --config '${{ matrix.type }}' else - make -C bld -j5 V=1 install + make -C bld V=1 install fi - name: 'curl version' @@ -313,7 +316,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --config '${{ matrix.type }}' --target testdeps else - make -C bld -j5 V=1 -C tests + make -C bld V=1 -C tests fi if [ '${{ matrix.build }}' != 'cmake' ]; then # avoid libtool's .exe wrappers @@ -350,7 +353,7 @@ jobs: cmake --build bld --config '${{ matrix.type }}' --target test-ci else PATH="$PWD/bld/lib/.libs:$PATH" - make -C bld -j5 V=1 test-ci + make -C bld V=1 test-ci fi - name: 'build examples' @@ -360,7 +363,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --config '${{ matrix.type }}' --target curl-examples else - make -C bld -j5 V=1 examples + make -C bld V=1 examples fi mingw-w64-standalone-downloads: @@ -370,6 +373,8 @@ jobs: defaults: run: shell: C:\msys64\usr\bin\bash.exe {0} + env: + MAKEFLAGS: -j 5 strategy: matrix: include: @@ -457,7 +462,7 @@ jobs: timeout-minutes: 5 run: | PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" - cmake --build bld --config '${{ matrix.type }}' --parallel 5 + cmake --build bld --config '${{ matrix.type }}' - name: 'curl version' timeout-minutes: 1 @@ -471,7 +476,7 @@ jobs: timeout-minutes: 10 run: | PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" - cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps + cmake --build bld --config '${{ matrix.type }}' --target testdeps - name: 'install test prereqs' if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} @@ -506,19 +511,20 @@ jobs: timeout-minutes: 5 run: | PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" - cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target curl-examples + cmake --build bld --config '${{ matrix.type }}' --target curl-examples linux-cross-mingw-w64: name: "linux-mingw, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }}" runs-on: ubuntu-latest timeout-minutes: 15 + env: + TRIPLET: 'x86_64-w64-mingw32' + MAKEFLAGS: -j 5 strategy: fail-fast: false matrix: build: [autotools, cmake] compiler: [gcc] - env: - TRIPLET: 'x86_64-w64-mingw32' steps: - name: 'install packages' run: sudo apt-get -o Dpkg::Use-Pty=0 install mingw-w64 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }} @@ -564,7 +570,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld else - make -C bld -j5 + make -C bld fi - name: 'curl info' @@ -576,7 +582,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --target testdeps else - make -C bld -j5 -C tests + make -C bld -C tests fi - name: 'build examples' @@ -584,7 +590,7 @@ jobs: if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --target curl-examples else - make -C bld -j5 examples + make -C bld examples fi wince: @@ -859,7 +865,7 @@ jobs: timeout-minutes: 5 run: | PATH="/c/msys64/usr/bin:$PATH" - cmake --build bld --config '${{ matrix.type }}' --parallel 5 + cmake --build bld --config '${{ matrix.type }}' - name: 'curl version' timeout-minutes: 1 @@ -875,7 +881,7 @@ jobs: timeout-minutes: 10 run: | PATH="/c/msys64/usr/bin:$PATH" - cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps + cmake --build bld --config '${{ matrix.type }}' --target testdeps - name: 'install test prereqs' if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} @@ -917,4 +923,4 @@ jobs: timeout-minutes: 5 run: | PATH="/c/msys64/usr/bin:$PATH" - cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target curl-examples + cmake --build bld --config '${{ matrix.type }}' --target curl-examples