Skip to content

Use Windows ARM64 for RTools CI #3177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 20 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-24.04-arm]
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' },
Expand All @@ -41,27 +41,23 @@ jobs:
with:
python-version: '3.x'

- uses: r-lib/actions/setup-r@v2
- name: Download and install Rtools45
if: runner.os == 'Windows'
with:
r-version: 'release'
rtools-version: '45'

- name: Set path for Rtools45
if: runner.os == 'Windows'
run: echo "C:/rtools45/usr/bin;C:/rtools45/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
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' }
Invoke-WebRequest -Uri https://github.com/r-hub/rtools45/releases/download/latest/$RTOOLS.exe -OutFile "$RTOOLS.exe"
Start-Process -FilePath "$RTOOLS.exe" -ArgumentList "/install /norestart /verysilent /SUPPRESSMSGBOXES" -NoNewWindow -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

- name: Build Math libs
shell: pwsh
run: |
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

- name: Add TBB to PATH
if: runner.os == 'Windows'
shell: pwsh
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Run ${{ matrix.config.label }} unit tests
shell: pwsh
run: |
Expand All @@ -80,7 +76,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-24.04-arm]
os: [windows-11-arm, windows-latest, ubuntu-24.04-arm]
group: [1, 2, 3, 4, 5]

steps:
Expand All @@ -89,27 +85,23 @@ jobs:
with:
python-version: '3.x'

- uses: r-lib/actions/setup-r@v2
- name: Download and install Rtools45
if: runner.os == 'Windows'
with:
r-version: 'release'
rtools-version: '45'

- name: Set path for Rtools45
if: runner.os == 'Windows'
run: echo "C:/rtools45/usr/bin;C:/rtools45/x86_64-w64-mingw32.static.posix/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
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' }
Invoke-WebRequest -Uri https://github.com/r-hub/rtools45/releases/download/latest/$RTOOLS.exe -OutFile "$RTOOLS.exe"
Start-Process -FilePath "$RTOOLS.exe" -ArgumentList "/install /norestart /verysilent /SUPPRESSMSGBOXES" -NoNewWindow -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

- name: Build Math libs
shell: pwsh
run: |
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

- name: Add TBB to PATH
if: runner.os == 'Windows'
shell: pwsh
run: echo "D:/a/math/math/lib/tbb" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Run mix/fun unit tests
shell: pwsh
run: |
Expand Down