Skip to content

Commit 8fb8357

Browse files
committed
Use rhub2
1 parent cb79642 commit 8fb8357

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

.github/workflows/rhub.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# R-hub's genetic GitHub Actions workflow file. It's canonical location is at
2+
# https://github.com/r-hub/rhub2/blob/v1/inst/workflow/rhub.yaml
3+
# You can update this file to a newer version using the rhub2 package:
4+
#
5+
# rhub2::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.name || format('Manually run by {0}', github.triggering_actor) }} (${{ github.event.inputs.id }})
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+
28+
setup:
29+
runs-on: ubuntu-latest
30+
outputs:
31+
containers: ${{ steps.rhub-setup.outputs.containers }}
32+
platforms: ${{ steps.rhub-setup.outputs.platforms }}
33+
34+
steps:
35+
# NO NEED TO CHECKOUT HERE
36+
- uses: r-hub/rhub2/actions/rhub-setup@v1
37+
with:
38+
config: ${{ github.event.inputs.config }}
39+
id: rhub-setup
40+
41+
linux-containers:
42+
needs: setup
43+
if: ${{ needs.setup.outputs.containers != '[]' }}
44+
runs-on: ubuntu-latest
45+
name: ${{ matrix.config.label }}
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
config: ${{ fromJson(needs.setup.outputs.containers) }}
50+
container:
51+
image: ${{ matrix.config.container }}
52+
53+
steps:
54+
- uses: actions/checkout@v3
55+
- uses: r-hub/rhub2/actions/rhub-check@v1
56+
with:
57+
token: ${{ secrets.RHUB_TOKEN }}
58+
job-config: ${{ matrix.config.job-config }}
59+
60+
other-platforms:
61+
needs: setup
62+
if: ${{ needs.setup.outputs.platforms != '[]' }}
63+
runs-on: ${{ matrix.config.os }}
64+
name: ${{ matrix.config.label }}
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
config: ${{ fromJson(needs.setup.outputs.platforms) }}
69+
70+
steps:
71+
- uses: actions/checkout@v3
72+
- uses: r-hub/rhub2/actions/rhub-setup-r@v1
73+
with:
74+
job-config: ${{ matrix.config.job-config }}
75+
token: ${{ secrets.RHUB_TOKEN }}
76+
- uses: r-hub/rhub2/actions/rhub-check@v1
77+
with:
78+
job-config: ${{ matrix.config.job-config }}
79+
token: ${{ secrets.RHUB_TOKEN }}

0 commit comments

Comments
 (0)