Skip to content

Commit 03e2f6f

Browse files
authored
Update gh actions + pkgdown config + general upkeep (#309)
* `usethis::use_github_action('check-standard')` * Other action updates with `usethis::use_github_action()` * devtools::build_readme() * Redocument with roxygen2 7.3.1 and address warnings * `usethis::use_lifecycle()` * Use `lifecycle::badge()` pattern! * Update WORDLIST * Add favicons + tweak pkgdown config to use bootstrap 5 (adds a search bar) * Removes a hack no longer required for roxygen 7.3.1 * Add codecov badge + `usethis::use_cran_badge()` [ci skip]
1 parent 72897ca commit 03e2f6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+471
-192
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
^codecov\.yml$
99
^docs$
1010
^_pkgdown\.yml$
11+
^pkgdown$
1112
^cran-comments\.md$
1213
^\.github$
1314
^revdep$

.github/workflows/R-CMD-check.yaml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
name: R-CMD-check
10+
11+
jobs:
12+
R-CMD-check:
13+
runs-on: ${{ matrix.config.os }}
14+
15+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
config:
21+
- {os: macos-latest, r: 'release'}
22+
- {os: windows-latest, r: 'release'}
23+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
24+
- {os: ubuntu-latest, r: 'release'}
25+
- {os: ubuntu-latest, r: 'oldrel-1'}
26+
27+
env:
28+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
29+
R_KEEP_PKG_SOURCE: yes
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- uses: r-lib/actions/setup-pandoc@v2
35+
36+
- uses: r-lib/actions/setup-r@v2
37+
with:
38+
r-version: ${{ matrix.config.r }}
39+
http-user-agent: ${{ matrix.config.http-user-agent }}
40+
use-public-rspm: true
41+
42+
- uses: r-lib/actions/setup-r-dependencies@v2
43+
with:
44+
extra-packages: any::rcmdcheck
45+
needs: check
46+
47+
- uses: r-lib/actions/check-r-package@v2
48+
with:
49+
upload-snapshots: true
50+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/check-standard.yaml

-64
This file was deleted.

.github/workflows/pkgdown.yaml

+25-10
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
1-
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
1+
# 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
33
on:
44
push:
55
branches: [main, master]
6-
tags: ['*']
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
711

812
name: pkgdown
913

1014
jobs:
1115
pkgdown:
1216
runs-on: ubuntu-latest
17+
# Only restrict concurrency for non-PR jobs
18+
concurrency:
19+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1320
env:
1421
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
22+
permissions:
23+
contents: write
1524
steps:
16-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
1726

18-
- uses: r-lib/actions/setup-pandoc@v1
27+
- uses: r-lib/actions/setup-pandoc@v2
1928

20-
- uses: r-lib/actions/setup-r@v1
29+
- uses: r-lib/actions/setup-r@v2
2130
with:
2231
use-public-rspm: true
2332

@@ -26,8 +35,14 @@ jobs:
2635
extra-packages: any::pkgdown, local::.
2736
needs: website
2837

29-
- name: Deploy package
30-
run: |
31-
git config --local user.name "$GITHUB_ACTOR"
32-
git config --local user.email "[email protected]"
33-
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
38+
- name: Build site
39+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
40+
shell: Rscript {0}
41+
42+
- name: Deploy to GitHub pages 🚀
43+
if: github.event_name != 'pull_request'
44+
uses: JamesIves/[email protected]
45+
with:
46+
clean: false
47+
branch: gh-pages
48+
folder: docs

.github/workflows/pr-commands.yaml

+22-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
1+
# 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
33
on:
44
issue_comment:
@@ -8,66 +8,72 @@ name: Commands
88

99
jobs:
1010
document:
11-
if: startsWith(github.event.comment.body, '/document')
11+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
1212
name: document
1313
runs-on: ubuntu-latest
1414
env:
1515
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1818

19-
- uses: r-lib/actions/pr-fetch@v1
19+
- uses: r-lib/actions/pr-fetch@v2
2020
with:
2121
repo-token: ${{ secrets.GITHUB_TOKEN }}
2222

23-
- uses: r-lib/actions/setup-r@v1
23+
- uses: r-lib/actions/setup-r@v2
2424
with:
2525
use-public-rspm: true
2626

27-
- uses: r-lib/actions/setup-r-dependencies@v1
27+
- uses: r-lib/actions/setup-r-dependencies@v2
2828
with:
29-
extra-packages: roxygen2
29+
extra-packages: any::roxygen2
30+
needs: pr-document
3031

3132
- name: Document
32-
run: Rscript -e 'roxygen2::roxygenise()'
33+
run: roxygen2::roxygenise()
34+
shell: Rscript {0}
3335

3436
- name: commit
3537
run: |
3638
git config --local user.name "$GITHUB_ACTOR"
3739
git config --local user.email "[email protected]"
3840
git add man/\* NAMESPACE
3941
git commit -m 'Document'
40-
- uses: r-lib/actions/pr-push@v1
42+
43+
- uses: r-lib/actions/pr-push@v2
4144
with:
4245
repo-token: ${{ secrets.GITHUB_TOKEN }}
4346

4447
style:
45-
if: startsWith(github.event.comment.body, '/style')
48+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
4649
name: style
4750
runs-on: ubuntu-latest
4851
env:
4952
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
5053
steps:
51-
- uses: actions/checkout@v2
54+
- uses: actions/checkout@v4
5255

53-
- uses: r-lib/actions/pr-fetch@v1
56+
- uses: r-lib/actions/pr-fetch@v2
5457
with:
5558
repo-token: ${{ secrets.GITHUB_TOKEN }}
5659

57-
- uses: r-lib/actions/setup-r@v1
60+
- uses: r-lib/actions/setup-r@v2
5861

5962
- name: Install dependencies
60-
run: Rscript -e 'install.packages("styler")'
63+
run: install.packages("styler")
64+
shell: Rscript {0}
6165

6266
- name: Style
63-
run: Rscript -e 'styler::style_pkg()'
67+
run: styler::style_pkg()
68+
shell: Rscript {0}
6469

6570
- name: commit
6671
run: |
6772
git config --local user.name "$GITHUB_ACTOR"
6873
git config --local user.email "[email protected]"
6974
git add \*.R
7075
git commit -m 'Style'
71-
- uses: r-lib/actions/pr-push@v1
76+
77+
- uses: r-lib/actions/pr-push@v2
7278
with:
7379
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-coverage.yaml

+26-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
1+
# 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
33
on:
44
push:
@@ -15,16 +15,36 @@ jobs:
1515
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919

20-
- uses: r-lib/actions/setup-r@v1
20+
- uses: r-lib/actions/setup-r@v2
2121
with:
2222
use-public-rspm: true
2323

24-
- uses: r-lib/actions/setup-r-dependencies@v1
24+
- uses: r-lib/actions/setup-r-dependencies@v2
2525
with:
26-
extra-packages: covr
26+
extra-packages: any::covr
27+
needs: coverage
2728

2829
- name: Test coverage
29-
run: covr::codecov()
30+
run: |
31+
covr::codecov(
32+
quiet = FALSE,
33+
clean = FALSE,
34+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
35+
)
3036
shell: Rscript {0}
37+
38+
- name: Show testthat output
39+
if: always()
40+
run: |
41+
## --------------------------------------------------------------------
42+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
43+
shell: bash
44+
45+
- name: Upload test results
46+
if: failure()
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: coverage-test-failures
50+
path: ${{ runner.temp }}/package

DESCRIPTION

+1-3
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ Suggests:
6363
timeDate
6464
VignetteBuilder:
6565
knitr
66-
RdMacros:
67-
lifecycle
6866
ByteCompile: true
6967
Config/testthat/edition: 3
7068
Encoding: UTF-8
7169
Language: en-GB
7270
LazyData: true
7371
Roxygen: list(markdown = TRUE)
74-
RoxygenNote: 7.2.3
72+
RoxygenNote: 7.3.1

0 commit comments

Comments
 (0)