Skip to content

Commit b440755

Browse files
authored
Add CI tests and releases for Windows arm64 (#940)
1 parent 203fbbc commit b440755

File tree

4 files changed

+65
-7
lines changed

4 files changed

+65
-7
lines changed

.github/workflows/release-windows.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414
build_windows:
1515
name: Build Windows
16-
runs-on: windows-latest
16+
runs-on: ${{ matrix.runs_on }}
1717
timeout-minutes: 40
1818

1919
env:
@@ -22,11 +22,15 @@ jobs:
2222

2323
strategy:
2424
matrix:
25-
arch: [x64]
25+
arch: [x64, arm64]
2626
flavor: [debug, release]
2727
include:
2828
- arch: x64
29+
runs_on: windows-latest
2930
rust_target_prefix: x86_64
31+
- arch: arm64
32+
runs_on: windows-11-arm
33+
rust_target_prefix: aarch64
3034

3135
steps:
3236
- name: Checkout sources

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ jobs:
121121
with:
122122
name: ark-${{ matrix.flavor }}-windows-x64-archive
123123

124+
- name: Download Windows arm64 kernel (${{ matrix.flavor}})
125+
uses: actions/download-artifact@v4
126+
with:
127+
name: ark-${{ matrix.flavor }}-windows-arm64-archive
128+
124129
- name: Download Linux x64 kernel (${{ matrix.flavor}})
125130
uses: actions/download-artifact@v4
126131
with:
@@ -147,6 +152,14 @@ jobs:
147152
tag_name: ${{ needs.get_version.outputs.ARK_VERSION }}
148153
files: ark-${{ needs.get_version.outputs.ARK_VERSION }}${{ env.DEBUG_FLAG }}-windows-x64.zip
149154

155+
- name: Upload Windows release artifact (arm64)
156+
uses: softprops/action-gh-release@v2
157+
env:
158+
GITHUB_TOKEN: ${{ github.token }}
159+
with:
160+
tag_name: ${{ needs.get_version.outputs.ARK_VERSION }}
161+
files: ark-${{ needs.get_version.outputs.ARK_VERSION }}${{ env.DEBUG_FLAG }}-windows-arm64.zip
162+
150163
- name: Upload Linux release artifacts (x64)
151164
uses: softprops/action-gh-release@v2
152165
env:

.github/workflows/test-windows.yml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@ on:
66

77
jobs:
88
windows:
9-
runs-on: windows-latest
10-
name: "Rust: ${{ matrix.config.rust }}, R: ${{ matrix.config.r }}"
9+
runs-on: ${{ matrix.runs_on }}
10+
name: "Rust: ${{ matrix.config.rust }}, R: ${{ matrix.config.r }}, Arch: ${{ matrix.arch }}"
11+
1112
strategy:
1213
fail-fast: false
1314
matrix:
15+
arch: [x64, arm64]
1416
config:
1517
- { rust: 'stable', r: 'release' }
18+
include:
19+
- arch: x64
20+
runs_on: windows-latest
21+
- arch: arm64
22+
runs_on: windows-11-arm
23+
1624
timeout-minutes: 30
1725
env:
1826
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -30,13 +38,32 @@ jobs:
3038
with:
3139
tool: cargo-nextest
3240

33-
- name: Install R
41+
# x86_64: Use setup-r
42+
- name: Install R (x64)
43+
if: matrix.arch == 'x64'
3444
uses: r-lib/actions/setup-r@v2
3545
with:
3646
r-version: ${{ matrix.config.r }}
3747
use-public-rspm: true
3848

39-
- name: Install R Packages Required For Tests
49+
# arm64: Manual R install (until setup-r supports arm64)
50+
- name: Install R (arm64)
51+
if: matrix.arch == 'arm64'
52+
run: |
53+
curl -L -o R-installer.exe https://www.r-project.org/nosvn/winutf8/aarch64/R-4-signed/R-4.5.1-aarch64.exe
54+
Start-Process -Wait -FilePath .\R-installer.exe -ArgumentList '/VERYSILENT', '/DIR=C:\R'
55+
echo "C:\R\bin" >> $env:GITHUB_PATH
56+
57+
# arm64: Install Rtools (until setup-r supports arm64)
58+
- name: Install Rtools45 (arm64)
59+
if: matrix.arch == 'arm64'
60+
run: |
61+
curl -L -o rtools45-installer.exe https://github.com/r-hub/rtools45/releases/download/latest/rtools45-aarch64.exe
62+
Start-Process -Wait -FilePath .\rtools45-installer.exe -ArgumentList '/VERYSILENT'
63+
64+
# x86_64: Use setup-r-dependencies
65+
- name: Install R Packages Required For Tests (x64)
66+
if: matrix.arch == 'x64'
4067
uses: r-lib/actions/setup-r-dependencies@v2
4168
with:
4269
packages:
@@ -48,6 +75,12 @@ jobs:
4875
R6
4976
survival
5077

78+
# arm64: Manual install.packages (until setup-r-dependencies supports arm64)
79+
- name: Install R Packages Required For Tests (arm64)
80+
if: matrix.arch == 'arm64'
81+
run: |
82+
Rscript -e "install.packages(c('data.table', 'dplyr', 'rstudioapi', 'tibble', 'haven', 'R6', 'survival'), repos = 'https://cloud.r-project.org')"
83+
5184
- name: Build
5285
run: |
5386
cargo build

crates/harp/src/sys/windows/library.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,13 @@ pub fn open_r_shared_library(path: &PathBuf) -> Result<libloading::Library, libl
9090
}
9191

9292
pub fn find_r_shared_library_folder(path: &PathBuf) -> PathBuf {
93-
path.join("bin").join("x64")
93+
#[cfg(target_arch = "aarch64")]
94+
{
95+
// arm64 has a flatter structure
96+
path.join("bin")
97+
}
98+
#[cfg(not(target_arch = "aarch64"))]
99+
{
100+
path.join("bin").join("x64")
101+
}
94102
}

0 commit comments

Comments
 (0)