From a2ade9dec49e70c6acd447df52321988a4c2fb9f Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Sat, 2 Mar 2024 03:39:45 +0100 Subject: [PATCH] GHA: Sync main.yml with DMD repo's --- .github/workflows/main.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58b087c5d..ed27c241e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,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: dmd - N: ${{ startsWith(matrix.os, 'macos') && '3' || '4' }} + # N is set dynamically below FULL_BUILD: false # work around https://issues.dlang.org/show_bug.cgi?id=23517 MACOSX_DEPLOYMENT_TARGET: '11' @@ -71,6 +71,9 @@ jobs: git clone --branch "$REPO_BRANCH" --depth 1 https://github.com/dlang/dmd.git ../dmd + - 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: cd ../dmd && ${{ runner.os == 'macOS' && 'ci/cirrusci.sh' || 'sudo -E ci/cirrusci.sh' }} @@ -80,6 +83,13 @@ jobs: with: arch: ${{ env.MODEL == '64' && 'x64' || 'x86' }} + # NOTE: Linker ICEs with Xcode 15.0.1 (default version on macos-13) + # * https://issues.dlang.org/show_bug.cgi?id=24407 + # Remove this step if the default gets changed to 15.1 in actions/runner-images. + - name: 'macOS 13: Switch to Xcode v15.1' + if: matrix.os == 'macos-13' + run: sudo xcode-select -switch /Applications/Xcode_15.1.app + - name: 'Posix: Install host compiler' if: runner.os != 'Windows' run: cd ../dmd && ci/run.sh install_host_compiler @@ -127,6 +137,7 @@ jobs: operating_system: freebsd hypervisor: qemu memory: 12G + cpu_count: 4 sync_files: runner-to-vm version: ${{ matrix.freebsd_version }} shell: bash @@ -139,7 +150,7 @@ jobs: export OS_NAME=freebsd export MODEL=64 export HOST_DMD=dmd - export N=3 + export N="$(nproc)" export FULL_BUILD=false export CI_DFLAGS="-version=TARGET_FREEBSD${freebsd_major}"