-
-
Notifications
You must be signed in to change notification settings - Fork 18
170 lines (150 loc) · 5.36 KB
/
rhub.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# This workflow is based on R-hub's generic GitHub Actions workflow file.
# Its canonical location is at
# https://github.com/r-hub/actions/blob/main/workflows/rhub.yaml
name: R-hub 🌐
on:
workflow_call:
secrets:
REPO_GITHUB_TOKEN:
description: |
Github token with read access to repositories
required: false
inputs:
config:
description: "A comma separated list of R-hub platforms to use."
type: string
# These platforms correspond roughly to CRAN package checks.
# More information: https://github.com/insightsengineering/idr-tasks/issues/781
# All supported R-hub platforms can be viewed by running: rhub::rhub_platforms()
# Container-based platforms (as opposed to VM-based Windows and macOS platforms)
# can be also viewed here: https://r-hub.github.io/containers/containers.html
# gcc14 = r-devel-linux-x86_64-fedora-gcc
#
# "linux" check (linux (R-devel)) is temporarily disabled because of unexplained timeouts
# in setup-r-dependencies step "Modify DESCRIPTION file (development)"
default: >-
r-devel-linux-x86_64-debian-clang,
r-devel-linux-x86_64-debian-gcc,
gcc14,
r-devel-windows-x86_64,
r-patched-linux-x86_64,
r-release-linux-x86_64,
r-release-macos-arm64,
r-release-macos-x86_64,
r-release-windows-x86_64,
r-oldrel-macos-arm64,
r-oldrel-macos-x86_64,
r-oldrel-windows-x86_64,
gcc13,
noSuggests,
donttest
lookup-refs:
description: |
List of package references to be used for the feature branch.
Multiple entries in new lines or separated by commas.
required: false
default: ""
type: string
concurrency:
group: r-hub-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
setup:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.rhub-setup.outputs.containers }}
platforms: ${{ steps.rhub-setup.outputs.platforms }}
steps:
- uses: r-hub/actions/setup@v1
with:
config: ${{ inputs.config }}
id: rhub-setup
linux-containers:
needs: setup
if: ${{ needs.setup.outputs.containers != '[]' }}
runs-on: ubuntu-latest
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.containers) }}
container:
image: ${{ matrix.config.container }}
steps:
- name: Setup token 🔑
id: github-token
run: |
if [ "${{ secrets.REPO_GITHUB_TOKEN }}" == "" ]; then
echo "REPO_GITHUB_TOKEN is empty. Substituting it with GITHUB_TOKEN."
echo "token=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_OUTPUT
else
echo "Using REPO_GITHUB_TOKEN."
echo "token=${{ secrets.REPO_GITHUB_TOKEN }}" >> $GITHUB_OUTPUT
fi
shell: bash
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/platform-info@v1
with:
job-config: ${{ matrix.config.job-config }}
- uses: insightsengineering/setup-r-dependencies@v1
env:
GITHUB_PAT: ${{ steps.github-token.outputs.token }}
with:
lookup-refs: ${{ inputs.lookup-refs }}
skip-install: true
restore-description: false
install-quarto: "false"
- uses: r-hub/actions/setup-deps@v1
with:
job-config: ${{ matrix.config.job-config }}
needs: DepsDev,DepsBranch
env:
GITHUB_PAT: ${{ steps.github-token.outputs.token }}
- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}
other-platforms:
needs: setup
if: ${{ needs.setup.outputs.platforms != '[]' }}
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.platforms) }}
steps:
- name: Setup token 🔑
id: github-token
run: |
if [ "${{ secrets.REPO_GITHUB_TOKEN }}" == "" ]; then
echo "REPO_GITHUB_TOKEN is empty. Substituting it with GITHUB_TOKEN."
echo "token=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_OUTPUT
else
echo "Using REPO_GITHUB_TOKEN."
echo "token=${{ secrets.REPO_GITHUB_TOKEN }}" >> $GITHUB_OUTPUT
fi
shell: bash
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/setup-r@v1
with:
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/platform-info@v1
with:
job-config: ${{ matrix.config.job-config }}
- uses: insightsengineering/setup-r-dependencies@v1
env:
GITHUB_PAT: ${{ steps.github-token.outputs.token }}
with:
lookup-refs: ${{ inputs.lookup-refs }}
skip-install: true
restore-description: false
install-quarto: "false"
- uses: r-hub/actions/setup-deps@v1
with:
job-config: ${{ matrix.config.job-config }}
needs: DepsDev,DepsBranch
env:
GITHUB_PAT: ${{ steps.github-token.outputs.token }}
- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}