Skip to content

Commit 006917c

Browse files
committed
add workflow file rhub
1 parent f6730b7 commit 006917c

1 file changed

Lines changed: 99 additions & 0 deletions

File tree

.github/workflows/rhub.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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: >-
11+
${{ github.event.inputs.id || format('Manual run by @{0}', github.triggering_actor) }}:
12+
${{ github.event.inputs.name || github.event.inputs.config }}
13+
14+
on:
15+
workflow_dispatch:
16+
inputs:
17+
config:
18+
description: >-
19+
Comma-separated list of R-hub platforms to use.
20+
Full list: https://r-hub.github.io/containers/
21+
type: string
22+
default: 'linux,windows,macos'
23+
name:
24+
description: 'Run name. You can leave this empty.'
25+
type: string
26+
id:
27+
description: 'Unique ID. You can leave this empty.'
28+
type: string
29+
30+
jobs:
31+
32+
setup:
33+
runs-on: ubuntu-latest
34+
outputs:
35+
containers: ${{ steps.rhub-setup.outputs.containers }}
36+
platforms: ${{ steps.rhub-setup.outputs.platforms }}
37+
38+
steps:
39+
# NO NEED TO CHECKOUT HERE
40+
- uses: r-hub/actions/setup@v1
41+
with:
42+
config: ${{ github.event.inputs.config }}
43+
id: rhub-setup
44+
45+
linux-containers:
46+
needs: setup
47+
if: ${{ needs.setup.outputs.containers != '[]' }}
48+
runs-on: ubuntu-latest
49+
name: ${{ matrix.config.label }}
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
config: ${{ fromJson(needs.setup.outputs.containers) }}
54+
container:
55+
image: ${{ matrix.config.container }}
56+
57+
steps:
58+
- uses: r-hub/actions/checkout@v1
59+
- uses: r-hub/actions/platform-info@v1
60+
with:
61+
token: ${{ secrets.RHUB_TOKEN }}
62+
job-config: ${{ matrix.config.job-config }}
63+
- uses: r-hub/actions/setup-deps@v1
64+
with:
65+
token: ${{ secrets.RHUB_TOKEN }}
66+
job-config: ${{ matrix.config.job-config }}
67+
- uses: r-hub/actions/run-check@v1
68+
with:
69+
token: ${{ secrets.RHUB_TOKEN }}
70+
job-config: ${{ matrix.config.job-config }}
71+
72+
other-platforms:
73+
needs: setup
74+
if: ${{ needs.setup.outputs.platforms != '[]' }}
75+
runs-on: ${{ matrix.config.os }}
76+
name: ${{ matrix.config.label }}
77+
strategy:
78+
fail-fast: false
79+
matrix:
80+
config: ${{ fromJson(needs.setup.outputs.platforms) }}
81+
82+
steps:
83+
- uses: r-hub/actions/checkout@v1
84+
- uses: r-hub/actions/setup-r@v1
85+
with:
86+
job-config: ${{ matrix.config.job-config }}
87+
token: ${{ secrets.RHUB_TOKEN }}
88+
- uses: r-hub/actions/platform-info@v1
89+
with:
90+
token: ${{ secrets.RHUB_TOKEN }}
91+
job-config: ${{ matrix.config.job-config }}
92+
- uses: r-hub/actions/setup-deps@v1
93+
with:
94+
job-config: ${{ matrix.config.job-config }}
95+
token: ${{ secrets.RHUB_TOKEN }}
96+
- uses: r-hub/actions/run-check@v1
97+
with:
98+
job-config: ${{ matrix.config.job-config }}
99+
token: ${{ secrets.RHUB_TOKEN }}

0 commit comments

Comments
 (0)