Skip to content

Commit d324929

Browse files
committed
Attempt to add macos arm build to the CI workflow.
Adding macos arm to the set of GitHub runners and supported binary distributions. This currently fails on GitHub due to limited runner resources that result in "Cancelled after 360m". It is not an issue with macos-arm64 per-se, as the tests for this configuration on pass on the CircleCI runner. Keeping the code that renames the arm64 artifacts differently from the x86_64 artifacts for later use (expect this issue to be resolved with SimpleITK 3.0.0).
1 parent 983ab86 commit d324929

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

.circleci/config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ jobs:
4141
R_VERSION="<< parameters.r-version >>"
4242
# Install rig, R Installation Manager (https://github.com/r-lib/rig) to control installed R version
4343
if [ "$RUNNER_OS" == "macos" ]; then
44-
brew install --cask r-lib/rig/rig
44+
# Install specific version of rig (0.8.0) directly from GitHub releases
45+
curl -L https://github.com/r-lib/rig/releases/download/v0.8.0/rig-macos-latest.pkg -o /tmp/rig.pkg
46+
sudo installer -pkg /tmp/rig.pkg -target /
4547
rig add $R_VERSION
4648
# on macOS the R package is installed into a MAJOR.MINOR directory
4749
# the PATCH is ignored (only one patch version supported) the

.github/workflows/main.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,13 @@ jobs:
9696
PKG_VERSION=$(Rscript -e "cat(read.dcf('DESCRIPTION', 'Version')[1])")
9797
9898
if [[ "$RUNNER_OS" == "macOS" ]]; then
99-
PKG_NAME="SimpleITK_${PKG_VERSION}_R${R_VERSION_SHORT}_macos-x86_64.tgz"
99+
# Detect architecture: arm64 or x86_64
100+
ARCH=$(uname -m)
101+
if [[ "$ARCH" == "arm64" || "$ARCH" == "aarch64" ]]; then
102+
PKG_NAME="SimpleITK_${PKG_VERSION}_R${R_VERSION_SHORT}_macos-arm64.tgz"
103+
else
104+
PKG_NAME="SimpleITK_${PKG_VERSION}_R${R_VERSION_SHORT}_macos-x86_64.tgz"
105+
fi
100106
elif [[ "$RUNNER_OS" == "Linux" ]]; then
101107
PKG_NAME="SimpleITK_${PKG_VERSION}_R${R_VERSION_SHORT}_linux-x86_64.tar.gz"
102108
elif [[ "$RUNNER_OS" == "Windows" ]]; then

0 commit comments

Comments
 (0)