18
18
workflow_dispatch :
19
19
inputs :
20
20
ref :
21
- description : " Branch or tag to check out"
21
+ description : " Branch, tag, or commit to check out"
22
22
required : false
23
23
default : " main"
24
+ versions-matrix :
25
+ description : " Create a matrix of R versions"
26
+ type : boolean
27
+ default : false
28
+ dep-suggests-matrix :
29
+ description : " Create a matrix of suggested dependencies"
30
+ type : boolean
31
+ default : false
24
32
merge_group :
25
33
types :
26
34
- checks_requested
51
59
with :
52
60
ref : ${{ inputs.ref }}
53
61
62
+ - name : Update status for rcc
63
+ # FIXME: Wrap into action
64
+ if : github.event_name == 'workflow_dispatch'
65
+ env :
66
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67
+ run : |
68
+ # Check status of this workflow
69
+ state="pending"
70
+ sha=${{ inputs.ref }}
71
+ if [ -z "${sha}" ]; then
72
+ sha=${{ github.head_ref }}
73
+ fi
74
+ if [ -z "${sha}" ]; then
75
+ sha=${{ github.sha }}
76
+ fi
77
+ sha=$(git rev-parse ${sha})
78
+
79
+ html_url=$(gh api \
80
+ -H "Accept: application/vnd.github+json" \
81
+ -H "X-GitHub-Api-Version: 2022-11-28" \
82
+ repos/${{ github.repository }}/actions/runs/${{ github.run_id }} | jq -r .html_url)
83
+
84
+ description="${{ github.workflow }} / ${{ github.job }}"
85
+
86
+ gh api \
87
+ --method POST \
88
+ -H "Accept: application/vnd.github+json" \
89
+ -H "X-GitHub-Api-Version: 2022-11-28" \
90
+ repos/${{ github.repository }}/statuses/${sha} \
91
+ -f "state=${state}" -f "target_url=${html_url}" -f "description=${description}" -f "context=rcc"
92
+ shell : bash
93
+
54
94
- uses : ./.github/workflows/rate-limit
55
95
with :
56
96
token : ${{ secrets.GITHUB_TOKEN }}
@@ -66,25 +106,29 @@ jobs:
66
106
cache-version : rcc-smoke-2
67
107
needs : check, website
68
108
# Beware of using dev pkgdown here, has brought in dev dependencies in the past
69
- extra-packages : any::rcmdcheck r-lib/roxygen2 any::decor r-lib/styler pkgdown deps::.
109
+ extra-packages : any::rcmdcheck r-lib/roxygen2 any::decor r-lib/styler r-lib/ pkgdown@f-readme-tweak deps::.
70
110
71
111
- name : Install package
72
112
run : |
73
- R CMD INSTALL .
113
+ _R_SHLIB_STRIP_=true R CMD INSTALL .
74
114
shell : bash
75
115
76
116
- uses : ./.github/workflows/custom/after-install
77
117
if : hashFiles('.github/workflows/custom/after-install/action.yml') != ''
78
118
79
119
- id : versions-matrix
80
- # Only run for pull requests if the base repo is different from the head repo, always run for other events
81
- if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
120
+ # Only run for pull requests if the base repo is different from the head repo, not for workflow_dispatch if not requested, always run for other events
121
+ if : ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository) && (github.event_name != 'workflow_dispatch' || inputs.versions-matrix)
82
122
uses : ./.github/workflows/versions-matrix
83
123
84
124
- id : dep-suggests-matrix
125
+ # Not for workflow_dispatch if not requested, always run for other events
126
+ if : github.event_name != 'workflow_dispatch' || inputs.dep-suggests-matrix
85
127
uses : ./.github/workflows/dep-suggests-matrix
86
128
87
129
- uses : ./.github/workflows/update-snapshots
130
+ with :
131
+ base : ${{ inputs.ref || github.head_ref }}
88
132
89
133
- uses : ./.github/workflows/style
90
134
@@ -120,6 +164,46 @@ jobs:
120
164
name : rcc-smoke-sha
121
165
path : rcc-smoke-sha.txt
122
166
167
+ - name : Update status for rcc
168
+ # FIXME: Wrap into action
169
+ if : always() && github.event_name == 'workflow_dispatch'
170
+ env :
171
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
172
+ run : |
173
+ # Check status of this workflow
174
+ if [ "${{ job.status }}" == "success" ]; then
175
+ state="success"
176
+ else
177
+ state="failure"
178
+ fi
179
+
180
+ sha=${{ steps.commit.outputs.sha }}
181
+ if [ -z "${sha}" ]; then
182
+ sha=${{ inputs.ref }}
183
+ fi
184
+ if [ -z "${sha}" ]; then
185
+ sha=${{ github.head_ref }}
186
+ fi
187
+ if [ -z "${sha}" ]; then
188
+ sha=${{ github.sha }}
189
+ fi
190
+ sha=$(git rev-parse ${sha})
191
+
192
+ html_url=$(gh api \
193
+ -H "Accept: application/vnd.github+json" \
194
+ -H "X-GitHub-Api-Version: 2022-11-28" \
195
+ repos/${{ github.repository }}/actions/runs/${{ github.run_id }} | jq -r .html_url)
196
+
197
+ description="${{ github.workflow }} / ${{ github.job }}"
198
+
199
+ gh api \
200
+ --method POST \
201
+ -H "Accept: application/vnd.github+json" \
202
+ -H "X-GitHub-Api-Version: 2022-11-28" \
203
+ repos/${{ github.repository }}/statuses/${sha} \
204
+ -f "state=${state}" -f "target_url=${html_url}" -f "description=${description}" -f "context=rcc"
205
+ shell : bash
206
+
123
207
rcc-smoke-check-matrix :
124
208
runs-on : ubuntu-latest
125
209
0 commit comments