Set SWIGJOBS environment variable automatically
Use the number of available CPUs + 1 which seems to work best with the number of actually available CPUs in the GitHub Actions environment.
This commit is contained in:
parent
bbfdedc18b
commit
7692d5f9ec
1 changed files with 16 additions and 2 deletions
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
|
|
@ -24,7 +24,6 @@ jobs:
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
#SWIGJOBS: ["-j2"]
|
|
||||||
# other variables to optionally set
|
# other variables to optionally set
|
||||||
# CC, GCC (used as suffix)
|
# CC, GCC (used as suffix)
|
||||||
# CPP11, CPP14, CPP17
|
# CPP11, CPP14, CPP17
|
||||||
|
|
@ -47,7 +46,6 @@ jobs:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
SWIGLANG: ${{ matrix.SWIGLANG }}
|
SWIGLANG: ${{ matrix.SWIGLANG }}
|
||||||
SWIGJOBS: ${{ matrix.SWIGJOBS }}
|
|
||||||
SWIG_FEATURES: ${{ matrix.SWIG_FEATURES }}
|
SWIG_FEATURES: ${{ matrix.SWIG_FEATURES }}
|
||||||
CONFIGOPTS: ${{ matrix.CONFIGOPTS }}
|
CONFIGOPTS: ${{ matrix.CONFIGOPTS }}
|
||||||
CC: ${{ matrix.CC }}
|
CC: ${{ matrix.CC }}
|
||||||
|
|
@ -77,6 +75,22 @@ jobs:
|
||||||
echo "${CONFIGOPTS[@]}"
|
echo "${CONFIGOPTS[@]}"
|
||||||
./autogen.sh && mkdir -p build/build && cd build/build && ../../configure "${CONFIGOPTS[@]}"
|
./autogen.sh && mkdir -p build/build && cd build/build && ../../configure "${CONFIGOPTS[@]}"
|
||||||
|
|
||||||
|
case $(uname) in
|
||||||
|
Linux)
|
||||||
|
cpu_count=$(nproc)
|
||||||
|
;;
|
||||||
|
|
||||||
|
Darwin)
|
||||||
|
cpu_count=$(sysctl -n hw.ncpu)
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
cpu_count=0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
((cpu_count++))
|
||||||
|
echo SWIGJOBS=-j$cpu_count >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue