1818 workflow_dispatch :
1919 inputs :
2020 ref :
21- description : " Branch or tag to check out"
21+ description : " Branch, tag, or commit to check out"
2222 required : false
2323 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
2432 merge_group :
2533 types :
2634 - checks_requested
@@ -33,6 +41,7 @@ concurrency:
3341
3442name : rcc
3543
44+
3645jobs :
3746 rcc-smoke :
3847 runs-on : ubuntu-latest
5160 with :
5261 ref : ${{ inputs.ref }}
5362
63+ - name : Update status for rcc
64+ # FIXME: Wrap into action
65+ if : github.event_name == 'workflow_dispatch'
66+ env :
67+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
68+ run : |
69+ # Check status of this workflow
70+ state="pending"
71+ sha=${{ inputs.ref }}
72+ if [ -z "${sha}" ]; then
73+ sha=${{ github.head_ref }}
74+ fi
75+ if [ -z "${sha}" ]; then
76+ sha=${{ github.sha }}
77+ fi
78+ sha=$(git rev-parse ${sha})
79+
80+ html_url=$(gh api \
81+ -H "Accept: application/vnd.github+json" \
82+ -H "X-GitHub-Api-Version: 2022-11-28" \
83+ repos/${{ github.repository }}/actions/runs/${{ github.run_id }} | jq -r .html_url)
84+
85+ description="${{ github.workflow }} / ${{ github.job }}"
86+
87+ gh api \
88+ --method POST \
89+ -H "Accept: application/vnd.github+json" \
90+ -H "X-GitHub-Api-Version: 2022-11-28" \
91+ repos/${{ github.repository }}/statuses/${sha} \
92+ -f "state=${state}" -f "target_url=${html_url}" -f "description=${description}" -f "context=rcc"
93+ shell : bash
94+
5495 - uses : ./.github/workflows/rate-limit
5596 with :
5697 token : ${{ secrets.GITHUB_TOKEN }}
@@ -66,25 +107,29 @@ jobs:
66107 cache-version : rcc-smoke-2
67108 needs : check, website
68109 # 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::.
110+ extra-packages : any::rcmdcheck r-lib/roxygen2 any::decor r-lib/styler r-lib/ pkgdown@f-readme-tweak deps::.
70111
71112 - name : Install package
72113 run : |
73- R CMD INSTALL .
114+ _R_SHLIB_STRIP_=true R CMD INSTALL .
74115 shell : bash
75116
76117 - uses : ./.github/workflows/custom/after-install
77118 if : hashFiles('.github/workflows/custom/after-install/action.yml') != ''
78119
79120 - 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
121+ # 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
122+ if : ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository) && (github.event_name != 'workflow_dispatch' || inputs.versions-matrix)
82123 uses : ./.github/workflows/versions-matrix
83124
84125 - id : dep-suggests-matrix
126+ # Not for workflow_dispatch if not requested, always run for other events
127+ if : github.event_name != 'workflow_dispatch' || inputs.dep-suggests-matrix
85128 uses : ./.github/workflows/dep-suggests-matrix
86129
87130 - uses : ./.github/workflows/update-snapshots
131+ with :
132+ base : ${{ inputs.ref || github.head_ref }}
88133
89134 - uses : ./.github/workflows/style
90135
@@ -120,6 +165,46 @@ jobs:
120165 name : rcc-smoke-sha
121166 path : rcc-smoke-sha.txt
122167
168+ - name : Update status for rcc
169+ # FIXME: Wrap into action
170+ if : always() && github.event_name == 'workflow_dispatch'
171+ env :
172+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
173+ run : |
174+ # Check status of this workflow
175+ if [ "${{ job.status }}" == "success" ]; then
176+ state="success"
177+ else
178+ state="failure"
179+ fi
180+
181+ sha=${{ steps.commit.outputs.sha }}
182+ if [ -z "${sha}" ]; then
183+ sha=${{ inputs.ref }}
184+ fi
185+ if [ -z "${sha}" ]; then
186+ sha=${{ github.head_ref }}
187+ fi
188+ if [ -z "${sha}" ]; then
189+ sha=${{ github.sha }}
190+ fi
191+ sha=$(git rev-parse ${sha})
192+
193+ html_url=$(gh api \
194+ -H "Accept: application/vnd.github+json" \
195+ -H "X-GitHub-Api-Version: 2022-11-28" \
196+ repos/${{ github.repository }}/actions/runs/${{ github.run_id }} | jq -r .html_url)
197+
198+ description="${{ github.workflow }} / ${{ github.job }}"
199+
200+ gh api \
201+ --method POST \
202+ -H "Accept: application/vnd.github+json" \
203+ -H "X-GitHub-Api-Version: 2022-11-28" \
204+ repos/${{ github.repository }}/statuses/${sha} \
205+ -f "state=${state}" -f "target_url=${html_url}" -f "description=${description}" -f "context=rcc"
206+ shell : bash
207+
123208 rcc-smoke-check-matrix :
124209 runs-on : ubuntu-latest
125210
0 commit comments