mirror of
https://github.com/dlang/dmd.git
synced 2025-04-25 20:50:41 +03:00
GHA: Set N parallelism dynamically
To adapt automatically to the number of available CPU cores.
This commit is contained in:
parent
c9f0c364f9
commit
65b6c2b62d
2 changed files with 9 additions and 4 deletions
7
.github/workflows/main.yml
vendored
7
.github/workflows/main.yml
vendored
|
@ -78,7 +78,7 @@ jobs:
|
|||
OS_NAME: ${{ startsWith(matrix.os, 'ubuntu') && 'linux' || (startsWith(matrix.os, 'macos') && 'osx' || (startsWith(matrix.os, 'windows') && 'windows' || '')) }}
|
||||
MODEL: ${{ matrix.model || '64' }}
|
||||
HOST_DMD: ${{ matrix.host_dmd }}
|
||||
N: ${{ startsWith(matrix.os, 'macos') && '3' || '4' }}
|
||||
# N is set dynamically below
|
||||
FULL_BUILD: true
|
||||
# for coverage:
|
||||
DMD_TEST_COVERAGE: ${{ matrix.coverage && '1' || '0' }}
|
||||
|
@ -92,6 +92,9 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 50
|
||||
|
||||
- name: Set environment variable N (parallelism)
|
||||
run: echo "N=$(${{ runner.os == 'macOS' && 'sysctl -n hw.logicalcpu' || 'nproc' }})" >> $GITHUB_ENV
|
||||
|
||||
- name: 'Posix: Install prerequisites'
|
||||
if: runner.os != 'Windows'
|
||||
run: ${{ runner.os == 'macOS' && 'ci/cirrusci.sh' || 'sudo -E ci/cirrusci.sh' }}
|
||||
|
@ -195,7 +198,7 @@ jobs:
|
|||
export OS_NAME=freebsd
|
||||
export MODEL=64
|
||||
export HOST_DMD='${{ matrix.host_dmd }}'
|
||||
export N=3
|
||||
export N="$(nproc)"
|
||||
export FULL_BUILD=true
|
||||
export CI_DFLAGS="-version=TARGET_FREEBSD${freebsd_major}"
|
||||
|
||||
|
|
6
.github/workflows/runnable_cxx.yml
vendored
6
.github/workflows/runnable_cxx.yml
vendored
|
@ -135,10 +135,12 @@ jobs:
|
|||
# Using a specific version for reproductibility.
|
||||
# Feel free to update when a new release has matured.
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
N: ${{ startsWith(matrix.os, 'macos') && '3' || '4' }}
|
||||
steps:
|
||||
|
||||
- name: Set environment variable N (parallelism)
|
||||
shell: bash
|
||||
run: echo "N=$(${{ runner.os == 'macOS' && 'sysctl -n hw.logicalcpu' || 'nproc' }})" >> $GITHUB_ENV
|
||||
|
||||
########################################
|
||||
# Setting up the host D compiler #
|
||||
########################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue