Skip to content

Commit dedc005

Browse files
committed
add rhub workflow
1 parent 06b56b3 commit dedc005

1 file changed

Lines changed: 94 additions & 0 deletions

File tree

.github/workflows/rhub.yaml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
2+
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
3+
# You can update this file to a newer version using the rhub2 package:
4+
#
5+
# rhub::rhub_setup()
6+
#
7+
# It is unlikely that you need to modify this file manually.
8+
9+
name: R-hub
10+
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"
11+
12+
on:
13+
workflow_dispatch:
14+
inputs:
15+
config:
16+
description: "A comma separated list of R-hub platforms to use."
17+
type: string
18+
default: "linux,windows,macos"
19+
name:
20+
description: "Run name. You can leave this empty now."
21+
type: string
22+
id:
23+
description: "Unique ID. You can leave this empty now."
24+
type: string
25+
26+
jobs:
27+
setup:
28+
runs-on: ubuntu-latest
29+
outputs:
30+
containers: ${{ steps.rhub-setup.outputs.containers }}
31+
platforms: ${{ steps.rhub-setup.outputs.platforms }}
32+
33+
steps:
34+
# NO NEED TO CHECKOUT HERE
35+
- uses: r-hub/actions/setup@v1
36+
with:
37+
config: ${{ github.event.inputs.config }}
38+
id: rhub-setup
39+
40+
linux-containers:
41+
needs: setup
42+
if: ${{ needs.setup.outputs.containers != '[]' }}
43+
runs-on: ubuntu-latest
44+
name: ${{ matrix.config.label }}
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
config: ${{ fromJson(needs.setup.outputs.containers) }}
49+
container:
50+
image: ${{ matrix.config.container }}
51+
52+
steps:
53+
- uses: r-hub/actions/checkout@v4
54+
- uses: r-hub/actions/platform-info@v2
55+
with:
56+
token: ${{ secrets.RHUB_TOKEN }}
57+
job-config: ${{ matrix.config.job-config }}
58+
- uses: r-hub/actions/setup-deps@v2
59+
with:
60+
token: ${{ secrets.RHUB_TOKEN }}
61+
job-config: ${{ matrix.config.job-config }}
62+
- uses: r-hub/actions/run-check@v2
63+
with:
64+
token: ${{ secrets.RHUB_TOKEN }}
65+
job-config: ${{ matrix.config.job-config }}
66+
67+
other-platforms:
68+
needs: setup
69+
if: ${{ needs.setup.outputs.platforms != '[]' }}
70+
runs-on: ${{ matrix.config.os }}
71+
name: ${{ matrix.config.label }}
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
config: ${{ fromJson(needs.setup.outputs.platforms) }}
76+
77+
steps:
78+
- uses: r-hub/actions/checkout@v4
79+
- uses: r-hub/actions/setup-r@v2
80+
with:
81+
job-config: ${{ matrix.config.job-config }}
82+
token: ${{ secrets.RHUB_TOKEN }}
83+
- uses: r-hub/actions/platform-info@v2
84+
with:
85+
token: ${{ secrets.RHUB_TOKEN }}
86+
job-config: ${{ matrix.config.job-config }}
87+
- uses: r-hub/actions/setup-deps@v2
88+
with:
89+
job-config: ${{ matrix.config.job-config }}
90+
token: ${{ secrets.RHUB_TOKEN }}
91+
- uses: r-hub/actions/run-check@v2
92+
with:
93+
job-config: ${{ matrix.config.job-config }}
94+
token: ${{ secrets.RHUB_TOKEN }}

0 commit comments

Comments
 (0)