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:
|
||||
matrix:
|
||||
#SWIGJOBS: ["-j2"]
|
||||
# other variables to optionally set
|
||||
# CC, GCC (used as suffix)
|
||||
# CPP11, CPP14, CPP17
|
||||
|
|
@ -47,7 +46,6 @@ jobs:
|
|||
|
||||
env:
|
||||
SWIGLANG: ${{ matrix.SWIGLANG }}
|
||||
SWIGJOBS: ${{ matrix.SWIGJOBS }}
|
||||
SWIG_FEATURES: ${{ matrix.SWIG_FEATURES }}
|
||||
CONFIGOPTS: ${{ matrix.CONFIGOPTS }}
|
||||
CC: ${{ matrix.CC }}
|
||||
|
|
@ -77,6 +75,22 @@ jobs:
|
|||
echo "${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
|
||||
shell: bash
|
||||
run: |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue