From 1e8e5182c7cbb16490739e25cef93f7556d9d60f Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 19 Jul 2026 16:10:50 +0800 Subject: [PATCH 1/2] Use standard action for rtools, restrict parallelism --- .github/workflows/main.yml | 45 ++++++++++++-------------------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f69327ef735..a6cfbba6692 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,14 +25,15 @@ jobs: runs-on: ${{ matrix.os }} strategy: fail-fast: false + max-parallel: 5 matrix: os: [windows-11-arm, windows-latest, ubuntu-24.04-arm] config: [ { label: misc, tests: 'test/unit/*_test.cpp test/unit/math/*_test.cpp test/unit/math/memory' }, { label: prim, tests: 'test/unit/math/prim' }, - { label: rev, tests: 'test/unit/math/rev' }, - { label: fwd, tests: 'test/unit/math/fwd' }, - { label: 'non-fun mix', tests: 'test/unit/math/mix/core test/unit/math/mix/meta test/unit/math/mix/*_test.cpp' } + { label: rev, tests: 'test/unit/math/rev' }, + { label: fwd, tests: 'test/unit/math/fwd' }, + { label: 'non-fun mix', tests: 'test/unit/math/mix/core test/unit/math/mix/meta test/unit/math/mix/*_test.cpp' } ] steps: @@ -43,24 +44,14 @@ jobs: - name: Download and Install Rtools45 if: runner.os == 'Windows' - run: | - $ARCH = if ('${{ matrix.os }}' -eq 'windows-11-arm') { 'aarch64' } else { 'x86_64' } - $RTOOLS = if ('${{ matrix.os }}' -eq 'windows-11-arm') { "rtools45-$ARCH" } else { 'rtools45' } - - # Installation will hang if the toolchain is already installed - if (-Not $(Test-Path -Path "C:/$RTOOLS")) { - Invoke-WebRequest ` - -Uri https://github.com/r-hub/rtools45/releases/download/latest/$RTOOLS.exe ` - -OutFile "$RTOOLS.exe" - Start-Process -FilePath "$RTOOLS.exe" -ArgumentList "/INSTALL /VERYSILENT /SUPPRESSMSGBOXES" -Wait - } - - echo "C:/$RTOOLS/usr/bin;C:/$RTOOLS/$ARCH-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - echo "$(pwd)/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + uses: r-lib/actions/setup-r@v2 + with: + r-version: 'release' - name: Build Math libs shell: pwsh run: | + echo "$(pwd)/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 Add-Content make\local "CPPFLAGS=-w -Wno-psabi -Wno-misleading-indentation`n" Add-Content make\local "STAN_THREADS=true`n" make -f make/standalone math-libs -j2 @@ -82,6 +73,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: fail-fast: false + max-parallel: 5 matrix: os: [windows-11-arm, windows-latest, ubuntu-24.04-arm] group: [1, 2, 3, 4, 5] @@ -94,24 +86,15 @@ jobs: - name: Download and Install Rtools45 if: runner.os == 'Windows' - run: | - $ARCH = if ('${{ matrix.os }}' -eq 'windows-11-arm') { 'aarch64' } else { 'x86_64' } - $RTOOLS = if ('${{ matrix.os }}' -eq 'windows-11-arm') { "rtools45-$ARCH" } else { 'rtools45' } - - # Installation will hang if the toolchain is already installed - if (-Not $(Test-Path -Path "C:/$RTOOLS")) { - Invoke-WebRequest ` - -Uri https://github.com/r-hub/rtools45/releases/download/latest/$RTOOLS.exe ` - -OutFile "$RTOOLS.exe" - Start-Process -FilePath "$RTOOLS.exe" -ArgumentList "/INSTALL /VERYSILENT /SUPPRESSMSGBOXES" -Wait - } - - echo "C:/$RTOOLS/usr/bin;C:/$RTOOLS/$ARCH-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - echo "$(pwd)/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + uses: r-lib/actions/setup-r@v2 + with: + r-version: 'release' + - name: Build Math libs shell: pwsh run: | + echo "$(pwd)/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 Add-Content make\local "CPPFLAGS=-w -Wno-psabi -Wno-misleading-indentation`n" Add-Content make\local "STAN_THREADS=true`n" make -f make/standalone math-libs -j2 From ac956459136fd7189f2907b64bf7f0985c3bf220 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 19 Jul 2026 16:11:49 +0800 Subject: [PATCH 2/2] Whitespace --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a6cfbba6692..7f0ec4501ee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,9 +31,9 @@ jobs: config: [ { label: misc, tests: 'test/unit/*_test.cpp test/unit/math/*_test.cpp test/unit/math/memory' }, { label: prim, tests: 'test/unit/math/prim' }, - { label: rev, tests: 'test/unit/math/rev' }, - { label: fwd, tests: 'test/unit/math/fwd' }, - { label: 'non-fun mix', tests: 'test/unit/math/mix/core test/unit/math/mix/meta test/unit/math/mix/*_test.cpp' } + { label: rev, tests: 'test/unit/math/rev' }, + { label: fwd, tests: 'test/unit/math/fwd' }, + { label: 'non-fun mix', tests: 'test/unit/math/mix/core test/unit/math/mix/meta test/unit/math/mix/*_test.cpp' } ] steps: