From ff6f702f2e69d149a9e92b0cc72dd3ef063cb450 Mon Sep 17 00:00:00 2001 From: Paul Colby Date: Fri, 10 Jan 2025 13:41:00 +1100 Subject: [PATCH] Use 3 or 4 cores, as appropriate, on GitHub Actions That is, use 4 cores everywhere, except only use 3 cores for macOS 14+. See https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories --- .github/workflows/build.yaml | 8 ++++++++ .github/workflows/docs.yaml | 1 + .github/workflows/lupdate.yaml | 3 +++ .github/workflows/sonar.yaml | 3 +++ .github/workflows/static.yaml | 3 +++ 5 files changed, 18 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2ea283cc1..df7d4b129 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,6 +5,12 @@ on: [ push, pull_request ] permissions: contents: read +env: + # Currently, GitHub-hosted runners for public repos specify 4 cores, except macOS 14+ + # See https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/ + # about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories + CMAKE_BUILD_PARALLEL_LEVEL: 4 # Default only; overridden where appriopriate, such as on macOS 14+ below. + jobs: linux: runs-on: ubuntu-24.04 @@ -150,6 +156,8 @@ jobs: mac: runs-on: ${{ matrix.os }} + env: + CMAKE_BUILD_PARALLEL_LEVEL: ${{ matrix.os == 'macos-13' && 4 || 3 }} timeout-minutes: 15 strategy: fail-fast: false diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 6329ce508..af3a634dc 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -6,6 +6,7 @@ permissions: contents: read env: + CMAKE_BUILD_PARALLEL_LEVEL: 4 DOXYGEN_VERSION: 1.13.1 jobs: diff --git a/.github/workflows/lupdate.yaml b/.github/workflows/lupdate.yaml index 111a37562..432d592d6 100644 --- a/.github/workflows/lupdate.yaml +++ b/.github/workflows/lupdate.yaml @@ -5,6 +5,9 @@ on: [ push, pull_request ] permissions: contents: read +env: + CMAKE_BUILD_PARALLEL_LEVEL: 4 + jobs: lupdate: runs-on: ubuntu-24.04 diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index e76741402..c787b9b44 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -11,6 +11,9 @@ on: permissions: contents: read +env: + CMAKE_BUILD_PARALLEL_LEVEL: 4 + jobs: build-and-scan: runs-on: ubuntu-24.04 diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml index 473fb181e..613eccc92 100644 --- a/.github/workflows/static.yaml +++ b/.github/workflows/static.yaml @@ -5,6 +5,9 @@ on: [ push, pull_request ] permissions: contents: read +env: + CMAKE_BUILD_PARALLEL_LEVEL: 4 + jobs: CodeQL: permissions: