Skip to content

Commit 293cc70

Browse files
committed
Try r-universe
1 parent fe6ac09 commit 293cc70

1 file changed

Lines changed: 111 additions & 1 deletion

File tree

dev/tasks/r/github.macos.cran.yml

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
jobs:
2323
macos-cran:
2424
name: "macOS similar to CRAN"
25-
runs-on: macOS-14
25+
runs-on: macOS-latest
2626
strategy:
2727
fail-fast: false
2828

@@ -80,3 +80,113 @@ jobs:
8080
name: test-output
8181
path: arrow-tests/testthat.Rout*
8282
if: always()
83+
84+
85+
# R-universe style build and check (macOS only)
86+
# Adapted from https://github.com/r-universe-org/workflows/blob/v3/.github/workflows/build.yml
87+
r-universe-source:
88+
name: "R-universe: Build source package"
89+
runs-on: ubuntu-latest
90+
timeout-minutes: 90
91+
outputs:
92+
sourcepkg: {{ "${{ steps.build.outputs.sourcepkg }}" }}
93+
package: {{ "${{ steps.build.outputs.package }}" }}
94+
version: {{ "${{ steps.build.outputs.version }}" }}
95+
steps:
96+
{{ macros.github_checkout_arrow()|indent }}
97+
98+
- name: Setup R
99+
uses: r-lib/actions/setup-r@v2
100+
with:
101+
use-public-rspm: true
102+
103+
- name: Build source package
104+
id: build
105+
run: |
106+
cd arrow/r
107+
PACKAGE=$(grep '^Package:' DESCRIPTION | cut -d' ' -f2)
108+
VERSION=$(grep '^Version:' DESCRIPTION | cut -d' ' -f2)
109+
echo "package=${PACKAGE}" >> $GITHUB_OUTPUT
110+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
111+
R CMD build .
112+
SOURCEPKG="${PACKAGE}_${VERSION}.tar.gz"
113+
echo "sourcepkg=${SOURCEPKG}" >> $GITHUB_OUTPUT
114+
115+
- name: Upload source package
116+
uses: actions/upload-artifact@v4
117+
with:
118+
name: r-universe-source
119+
path: arrow/r/{{ "${{ steps.build.outputs.sourcepkg }}" }}
120+
121+
r-universe-macos:
122+
needs: [r-universe-source]
123+
if: {{ "${{ !cancelled() && needs.r-universe-source.outputs.sourcepkg }}" }}
124+
runs-on: macos-{{ "${{ matrix.arch == 'x86_64' && '15-intel' || '15' }}" }}
125+
timeout-minutes: 120
126+
name: "R-universe: R-${{ "${{ matrix.r }}" }} macOS ${{ "${{ matrix.arch }}" }}"
127+
strategy:
128+
fail-fast: false
129+
matrix:
130+
r: [ 'devel', 'release' ]
131+
arch: [ 'x86_64', 'arm64' ]
132+
steps:
133+
- name: Download source package
134+
uses: actions/download-artifact@v4
135+
with:
136+
name: r-universe-source
137+
138+
- name: "Prepare macOS system"
139+
timeout-minutes: 10
140+
uses: r-universe-org/actions/macos-prep@v11
141+
with:
142+
version: {{ "${{ matrix.r }}" }}
143+
fortran: 'true'
144+
145+
- name: Install R-${{ "${{ matrix.r }}" }} for macOS
146+
timeout-minutes: 10
147+
uses: r-universe-org/actions/setup-r@v11
148+
id: install-r
149+
with:
150+
r-version: {{ "${{ matrix.r }}" }}
151+
152+
- name: "Get dependencies"
153+
id: deps
154+
uses: r-universe-org/actions/macos-deps@v11
155+
timeout-minutes: 60
156+
env:
157+
GITHUB_PAT: {{ "${{ secrets.GITHUB_TOKEN }}" }}
158+
with:
159+
sourcepkg: {{ "${{ needs.r-universe-source.outputs.sourcepkg }}" }}
160+
161+
- name: Build package "${{ "${{ needs.r-universe-source.outputs.package }}" }}"
162+
uses: r-universe-org/actions/macos-build@v11
163+
timeout-minutes: 90
164+
env:
165+
GITHUB_PAT: {{ "${{ secrets.GITHUB_TOKEN }}" }}
166+
with:
167+
sourcepkg: {{ "${{ needs.r-universe-source.outputs.sourcepkg }}" }}
168+
169+
- name: "R CMD check"
170+
uses: r-universe-org/actions/macos-check@v11
171+
id: check
172+
timeout-minutes: 60
173+
env:
174+
GITHUB_PAT: {{ "${{ secrets.GITHUB_TOKEN }}" }}
175+
with:
176+
sourcepkg: {{ "${{ needs.r-universe-source.outputs.sourcepkg }}" }}
177+
178+
- name: "Store binaries"
179+
id: artifact
180+
uses: r-universe-org/actions/store-package@v11
181+
if: {{ "${{ always() && steps.check.outputs.binarypkg }}" }}
182+
with:
183+
name: package-macos-{{ "${{ matrix.r }}" }}-{{ "${{ matrix.arch }}" }}
184+
JOB_STATUS: {{ "${{ job.status }}" }}
185+
DISTRO: macos
186+
FILE: {{ "${{ steps.check.outputs.binarypkg }}" }}
187+
CHECKSTATUS: {{ "${{ steps.check.outputs.checkstatus }}" }}
188+
TARGET: macos
189+
190+
- name: "Summary: macos-${{ "${{ matrix.r }}" }}-${{ "${{ matrix.arch }}" }}: ${{ "${{ steps.deps.outputs.rversion }}" }}: ${{ "${{ steps.check.outputs.checkstatus || 'FAIL' }}" }}"
191+
run: echo "Artifact URL ${{ "${{ steps.artifact.outputs.artifact-url }}" }}"
192+
if: always()

0 commit comments

Comments
 (0)