Skip to content

Commit 016010d

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into lcb/archive-filter
2 parents 751f547 + 231d979 commit 016010d

36 files changed

+1278
-611
lines changed

.github/pull_request_template.md

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ Please:
1414
(backwards-incompatible changes to the documented interface) are noted.
1515
Collect the changes under the next release number (e.g. if you are on
1616
1.7.2, then write your changes under the 1.8 heading).
17+
- [ ] Styling and documentation checks. Make a PR comment with:
18+
- `/document` to check the package documentation and fix any issues.
19+
- `/style` to check the style and fix any issues.
20+
- `/preview-docs` to preview the docs.
21+
- See Actions GitHub tab to track progress of these commands.
1722
- See [DEVELOPMENT.md](DEVELOPMENT.md) for more information on the development
1823
process.
1924

.github/workflows/doc-preview.yaml

-65
This file was deleted.

.github/workflows/document.yaml

-58
This file was deleted.

.github/workflows/lint.yaml

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3-
#
4-
# Modifications:
5-
# * workflow_dispatch added to allow manual triggering of the workflow
6-
# * trigger branches changed
7-
# * API key secrets.DELPHI_GITHUB_ACTIONS_EPIDATA_API_KEY
83
on:
94
push:
105
branches: [main, dev]
116
pull_request:
127
branches: [main, dev]
138
workflow_dispatch:
149

15-
name: Lint
10+
name: lint.yaml
11+
12+
permissions: read-all
1613

1714
jobs:
1815
lint:
1916
runs-on: ubuntu-latest
2017
env:
2118
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
22-
DELPHI_EPIDATA_KEY: ${{ secrets.DELPHI_GITHUB_ACTIONS_EPIDATA_API_KEY }}
2319
steps:
24-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2521

2622
- uses: r-lib/actions/setup-r@v2
2723
with:

.github/workflows/pr-commands.yaml

+149
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
# Modifications:
4+
# - Allow more roles to trigger each PR command
5+
# - Document builds README.md from README.Rmd with devtools::build_readme()
6+
# - Include a doc-preview command (uses Netlify to preview the docs)
7+
on:
8+
issue_comment:
9+
types: [created]
10+
11+
name: pr-commands.yaml
12+
13+
permissions: read-all
14+
15+
jobs:
16+
document:
17+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'CONTRIBUTOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
18+
name: document
19+
runs-on: ubuntu-latest
20+
env:
21+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
22+
permissions:
23+
contents: write
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- uses: r-lib/actions/pr-fetch@v2
28+
with:
29+
repo-token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- uses: r-lib/actions/setup-r@v2
32+
with:
33+
use-public-rspm: true
34+
35+
- uses: r-lib/actions/setup-r-dependencies@v2
36+
with:
37+
extra-packages: any::roxygen2
38+
needs: pr-document
39+
40+
- name: Document
41+
run: roxygen2::roxygenise()
42+
shell: Rscript {0}
43+
44+
- name: Build README.md from README.Rmd
45+
run: Rscript -e 'if (file.exists("README.Rmd")) devtools::build_readme()'
46+
47+
- name: commit
48+
run: |
49+
git config --local user.name "$GITHUB_ACTOR"
50+
git config --local user.email "[email protected]"
51+
git add man/\* NAMESPACE
52+
git commit -m 'Document'
53+
54+
- uses: r-lib/actions/pr-push@v2
55+
with:
56+
repo-token: ${{ secrets.GITHUB_TOKEN }}
57+
58+
style:
59+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'CONTRIBUTOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
60+
name: style
61+
runs-on: ubuntu-latest
62+
env:
63+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
64+
permissions:
65+
contents: write
66+
steps:
67+
- uses: actions/checkout@v4
68+
69+
- uses: r-lib/actions/pr-fetch@v2
70+
with:
71+
repo-token: ${{ secrets.GITHUB_TOKEN }}
72+
73+
- uses: r-lib/actions/setup-r@v2
74+
75+
- name: Install dependencies
76+
run: install.packages("styler")
77+
shell: Rscript {0}
78+
79+
- name: Style
80+
run: styler::style_pkg()
81+
shell: Rscript {0}
82+
83+
- name: commit
84+
run: |
85+
git config --local user.name "$GITHUB_ACTOR"
86+
git config --local user.email "[email protected]"
87+
git add \*.R
88+
git commit -m 'Style'
89+
90+
- uses: r-lib/actions/pr-push@v2
91+
with:
92+
repo-token: ${{ secrets.GITHUB_TOKEN }}
93+
94+
preview:
95+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'CONTRIBUTOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/preview-docs') }}
96+
97+
runs-on: ubuntu-latest
98+
permissions:
99+
# Needed to write a comment on the PR
100+
pull-requests: write
101+
# Needed to read the PR branch
102+
contents: read
103+
steps:
104+
- uses: actions/checkout@v4
105+
with:
106+
# Checkout the PR branch
107+
ref: refs/pull/${{ github.event.issue.number }}/head
108+
109+
- uses: r-lib/actions/setup-pandoc@v2
110+
111+
- uses: r-lib/actions/setup-r@v2
112+
with:
113+
use-public-rspm: true
114+
115+
- uses: r-lib/actions/setup-r-dependencies@v2
116+
with:
117+
extra-packages: any::pkgdown, local::.
118+
needs: website
119+
120+
- name: Build site
121+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
122+
shell: Rscript {0}
123+
124+
- name: Deploy to Netlify
125+
uses: nwtgck/[email protected]
126+
with:
127+
# Standard config
128+
github-token: ${{ secrets.GITHUB_TOKEN }}
129+
deploy-message: "Deploy from GitHub Actions"
130+
# 'docs/' is the default directory for pkgdown::build_site()
131+
# we add 'dev' because _pkgdown.yml has 'development: mode: devel'
132+
publish-dir: './docs/dev'
133+
# Development deploys only
134+
production-deploy: false
135+
# Enable pull request comment (default)
136+
enable-pull-request-comment: true
137+
# Overwrite the pull request comment with updated link (default)
138+
overwrites-pull-request-comment: true
139+
# Don't deploy to GitHub
140+
enable-github-deployment: false
141+
# Don't update the status of the commit
142+
enable-commit-status: false
143+
# Don't comment on the commit
144+
enable-commit-comment: false
145+
env:
146+
# Netlify credentials (currently from Dmitry's account)
147+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
148+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
149+
timeout-minutes: 1

0 commit comments

Comments
 (0)