Skip to content

Commit 91511b4

Browse files
authored
removing hardcoding number of parallel jobs in ci (#75)
1 parent b3dcb90 commit 91511b4

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

.github/workflows/main.yml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,21 @@ jobs:
5353
${{ matrix.micromamba_shell_init }}
5454
environment-name: xeus-cpp
5555

56+
- name: Setup default Build Type on *nux
57+
if: ${{ runner.os != 'windows' }}
58+
run: |
59+
os="${{ matrix.os }}"
60+
if [[ "${os}" == "macos"* ]]; then
61+
echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
62+
else
63+
echo "ncpus=$(nproc --all)" >> $GITHUB_ENV
64+
fi
65+
- name: Setup default Build Type on Windows
66+
if: ${{ runner.os == 'windows' }}
67+
run: |
68+
$env:ncpus=$([Environment]::ProcessorCount)
69+
echo "ncpus=$env:ncpus" >> $env:GITHUB_ENV
70+
5671
- name: micromamba shell hook
5772
if: ${{ runner.os == 'windows' }}
5873
shell: powershell
@@ -84,7 +99,7 @@ jobs:
8499
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
85100
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
86101
-DXEUS_CPP_ENABLE_CODE_COVERAGE=${{ matrix.coverage }} \
87-
${{ matrix.extra_cmake_flags }}
102+
${{ matrix.extra_cmake_flags }}
88103
89104
- name: build & install
90105
if: ${{ runner.os == 'windows' }}
@@ -100,7 +115,7 @@ jobs:
100115
shell: bash -l {0}
101116
run: |
102117
cd build
103-
make install -j 8
118+
make install -j ${{ env.ncpus }}
104119
105120
- name: Test xeus-cpp C++
106121
if: ${{ runner.os != 'windows' }}
@@ -169,6 +184,22 @@ jobs:
169184
init-shell: >-
170185
${{ matrix.micromamba_shell_init }}
171186
environment-name: xeus-cpp-wasm-build
187+
188+
- name: Setup default Build Type on *nux
189+
if: ${{ runner.os != 'windows' }}
190+
run: |
191+
os="${{ matrix.os }}"
192+
if [[ "${os}" == "macos"* ]]; then
193+
echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
194+
else
195+
echo "ncpus=$(nproc --all)" >> $GITHUB_ENV
196+
fi
197+
198+
- name: Setup default Build Type on Windows
199+
if: ${{ runner.os == 'windows' }}
200+
run: |
201+
$env:ncpus=$([Environment]::ProcessorCount)
202+
echo "ncpus=$env:ncpus" >> $env:GITHUB_ENV
172203
173204
- name: Setup emsdk
174205
shell: bash -l {0}
@@ -197,7 +228,7 @@ jobs:
197228
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
198229
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
199230
..
200-
EMCC_CFLAGS='-sERROR_ON_UNDEFINED_SYMBOLS=0' emmake make -j5
231+
EMCC_CFLAGS='-sERROR_ON_UNDEFINED_SYMBOLS=0' emmake make -j ${{ env.ncpus }}
201232
202233
- name: Setup tmate session
203234
if: ${{ failure() && runner.debug }}

0 commit comments

Comments
 (0)