Skip to content

Commit ab20789

Browse files
authored
Workflow updates (#358)
* use_tidy_description() and dd RStudio as funder * use_tidy_github_actions() * Update to latest pkgdown template * Mark S4 class registration as internal, and minimize Rd
1 parent f0a0f35 commit ab20789

File tree

11 files changed

+162
-292
lines changed

11 files changed

+162
-292
lines changed

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

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
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+
#
4+
# NOTE: This workflow is overkill for most R packages and
5+
# check-standard.yaml is likely a better choice.
6+
# usethis::use_github_action("check-standard") will install it.
17
on:
28
push:
9+
branches: [main, master]
310
pull_request:
11+
branches: [main, master]
412

513
name: R-CMD-check
614

@@ -14,15 +22,19 @@ jobs:
1422
fail-fast: false
1523
matrix:
1624
config:
25+
- {os: macOS-latest, r: 'release'}
26+
1727
- {os: windows-latest, r: 'release'}
18-
- {os: windows-2022, r: 'devel'}
19-
- {os: windows-2022, r: 'devel-ucrt'}
20-
- {os: macOS-latest, r: 'release'}
21-
- {os: ubuntu-18.04, r: '3.4'}
22-
- {os: ubuntu-18.04, r: '3.5'}
23-
- {os: ubuntu-18.04, r: '3.6'}
24-
- {os: ubuntu-18.04, r: '4.0'}
25-
- {os: ubuntu-18.04, r: '4.1'}
28+
# Use 3.6 to trigger usage of RTools35
29+
- {os: windows-latest, r: '3.6'}
30+
31+
# Use older ubuntu to maximise backward compatibility
32+
- {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'}
33+
- {os: ubuntu-18.04, r: 'release'}
34+
- {os: ubuntu-18.04, r: 'oldrel-1'}
35+
- {os: ubuntu-18.04, r: 'oldrel-2'}
36+
- {os: ubuntu-18.04, r: 'oldrel-3'}
37+
- {os: ubuntu-18.04, r: 'oldrel-4'}
2638

2739
env:
2840
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
@@ -31,28 +43,19 @@ jobs:
3143
steps:
3244
- uses: actions/checkout@v2
3345

34-
- uses: r-lib/actions/setup-pandoc@v1
46+
- uses: r-lib/actions/setup-pandoc@v2
3547

36-
- uses: r-lib/actions/setup-r@v1
48+
- uses: r-lib/actions/setup-r@v2
3749
with:
3850
r-version: ${{ matrix.config.r }}
3951
http-user-agent: ${{ matrix.config.http-user-agent }}
4052
use-public-rspm: true
4153

42-
- uses: r-lib/actions/setup-r-dependencies@v1
54+
- uses: r-lib/actions/setup-r-dependencies@v2
4355
with:
44-
extra-packages: rcmdcheck
45-
46-
- uses: r-lib/actions/check-r-package@HEAD
47-
48-
- name: Show testthat output
49-
if: always()
50-
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
51-
shell: bash
56+
extra-packages: any::rcmdcheck
57+
needs: check
5258

53-
- name: Upload check results
54-
if: failure()
55-
uses: actions/upload-artifact@main
59+
- uses: r-lib/actions/check-r-package@v2
5660
with:
57-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
58-
path: check
61+
upload-snapshots: true

.github/workflows/pkgdown.yaml

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
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
13
on:
24
push:
3-
branches: master
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
411

512
name: pkgdown
613

714
jobs:
815
pkgdown:
9-
runs-on: macOS-latest
16+
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 }}
20+
env:
21+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1022
steps:
1123
- uses: actions/checkout@v2
1224

13-
- uses: r-lib/actions/setup-r@master
25+
- uses: r-lib/actions/setup-pandoc@v2
1426

15-
- uses: r-lib/actions/setup-pandoc@master
16-
17-
- name: Query dependencies
18-
run: |
19-
install.packages('remotes')
20-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
21-
shell: Rscript {0}
27+
- uses: r-lib/actions/setup-r@v2
28+
with:
29+
use-public-rspm: true
2230

23-
- name: Cache R packages
24-
uses: actions/cache@v1
31+
- uses: r-lib/actions/setup-r-dependencies@v2
2532
with:
26-
path: ${{ env.R_LIBS_USER }}
27-
key: macOS-r-4.0-2-${{ hashFiles('depends.Rds') }}
28-
restore-keys: macOS-r-4.0-2-
33+
extra-packages: any::pkgdown, local::.
34+
needs: website
2935

30-
- name: Install dependencies
31-
run: |
32-
install.packages("remotes")
33-
remotes::install_deps(dependencies = TRUE)
34-
remotes::install_cran("pkgdown")
36+
- name: Build site
37+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
3538
shell: Rscript {0}
3639

37-
- name: Install package
38-
run: R CMD INSTALL .
39-
40-
- name: Deploy package
41-
run: |
42-
install.packages('xslt')
43-
pkgdown::deploy_to_branch(new_process = FALSE)
44-
shell: Rscript {0}
40+
- name: Deploy to GitHub pages 🚀
41+
if: github.event_name != 'pull_request'
42+
uses: JamesIves/github-pages-deploy-action@4.1.4
43+
with:
44+
clean: false
45+
branch: gh-pages
46+
folder: docs

.github/workflows/pr-commands.yaml

Lines changed: 47 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,79 @@
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
13
on:
24
issue_comment:
35
types: [created]
6+
47
name: Commands
8+
59
jobs:
610
document:
7-
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') }}
812
name: document
9-
runs-on: macOS-latest
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1016
steps:
1117
- uses: actions/checkout@v2
12-
- uses: r-lib/actions/pr-fetch@master
18+
19+
- uses: r-lib/actions/pr-fetch@v2
1320
with:
1421
repo-token: ${{ secrets.GITHUB_TOKEN }}
15-
- uses: r-lib/actions/setup-r@master
16-
- name: Install dependencies
17-
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)'
22+
23+
- uses: r-lib/actions/setup-r@v2
24+
with:
25+
use-public-rspm: true
26+
27+
- uses: r-lib/actions/setup-r-dependencies@v2
28+
with:
29+
extra-packages: any::roxygen2
30+
needs: pr-document
31+
1832
- name: Document
19-
run: Rscript -e 'roxygen2::roxygenise()'
33+
run: roxygen2::roxygenise()
34+
shell: Rscript {0}
35+
2036
- name: commit
2137
run: |
38+
git config --local user.name "$GITHUB_ACTOR"
39+
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
2240
git add man/\* NAMESPACE
2341
git commit -m 'Document'
24-
- uses: r-lib/actions/pr-push@master
42+
43+
- uses: r-lib/actions/pr-push@v2
2544
with:
2645
repo-token: ${{ secrets.GITHUB_TOKEN }}
46+
2747
style:
28-
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') }}
2949
name: style
30-
runs-on: macOS-latest
50+
runs-on: ubuntu-latest
51+
env:
52+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3153
steps:
3254
- uses: actions/checkout@v2
33-
- uses: r-lib/actions/pr-fetch@master
55+
56+
- uses: r-lib/actions/pr-fetch@v2
3457
with:
3558
repo-token: ${{ secrets.GITHUB_TOKEN }}
36-
- uses: r-lib/actions/setup-r@master
59+
60+
- uses: r-lib/actions/setup-r@v2
61+
3762
- name: Install dependencies
38-
run: Rscript -e 'install.packages("styler")'
63+
run: install.packages("styler")
64+
shell: Rscript {0}
65+
3966
- name: Style
40-
run: Rscript -e 'styler::style_pkg()'
67+
run: styler::style_pkg()
68+
shell: Rscript {0}
69+
4170
- name: commit
4271
run: |
72+
git config --local user.name "$GITHUB_ACTOR"
73+
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
4374
git add \*.R
4475
git commit -m 'Style'
45-
- uses: r-lib/actions/pr-push@master
76+
77+
- uses: r-lib/actions/pr-push@v2
4678
with:
4779
repo-token: ${{ secrets.GITHUB_TOKEN }}
48-
# A mock job just to ensure we have a successful build status
49-
finish:
50-
runs-on: ubuntu-latest
51-
steps:
52-
- run: true

.github/workflows/test-coverage.yaml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,31 @@
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
13
on:
24
push:
3-
branches:
4-
- master
5+
branches: [main, master]
56
pull_request:
6-
branches:
7-
- master
7+
branches: [main, master]
88

99
name: test-coverage
1010

1111
jobs:
1212
test-coverage:
13-
runs-on: macOS-latest
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
1417
steps:
1518
- uses: actions/checkout@v2
1619

17-
- uses: r-lib/actions/setup-r@master
18-
19-
- uses: r-lib/actions/setup-pandoc@master
20-
21-
- name: Query dependencies
22-
run: |
23-
install.packages('remotes')
24-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
25-
shell: Rscript {0}
26-
27-
- name: Cache R packages
28-
uses: actions/cache@v1
20+
- uses: r-lib/actions/setup-r@v2
2921
with:
30-
path: ${{ env.R_LIBS_USER }}
31-
key: macOS-r-4.0-2-${{ hashFiles('depends.Rds') }}
32-
restore-keys: macOS-r-4.0-2-
22+
use-public-rspm: true
3323

34-
- name: Install dependencies
35-
run: |
36-
install.packages(c("remotes"))
37-
remotes::install_deps(dependencies = TRUE)
38-
remotes::install_cran("covr")
39-
shell: Rscript {0}
24+
- uses: r-lib/actions/setup-r-dependencies@v2
25+
with:
26+
extra-packages: any::covr
27+
needs: coverage
4028

4129
- name: Test coverage
42-
run: covr::codecov()
30+
run: covr::codecov(quiet = FALSE)
4331
shell: Rscript {0}

.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

DESCRIPTION

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
Package: xml2
22
Title: Parse XML
33
Version: 1.3.3.9000
4-
Authors@R:
5-
c(person(given = "Hadley",
6-
family = "Wickham",
7-
role = c("aut", "cre"),
8-
email = "hadley@rstudio.com"),
9-
person(given = "Jim",
10-
family = "Hester",
11-
role = "aut"),
12-
person(given = "Jeroen",
13-
family = "Ooms",
14-
role = "aut"),
15-
person(given = "RStudio",
16-
role = "cph"),
17-
person(given = "R Foundation",
18-
role = "ctb",
19-
comment = "Copy of R-project homepage cached as example"))
20-
Description: Work with XML files using a simple, consistent
21-
interface. Built on top of the 'libxml2' C library.
4+
Authors@R: c(
5+
person("Hadley", "Wickham", , "hadley@rstudio.com", role = c("aut", "cre")),
6+
person("Jim", "Hester", role = "aut"),
7+
person("Jeroen", "Ooms", role = "aut"),
8+
person("RStudio", role = c("cph", "fnd")),
9+
person("R Foundation", role = "ctb",
10+
comment = "Copy of R-project homepage cached as example")
11+
)
12+
Description: Work with XML files using a simple, consistent interface.
13+
Built on top of the 'libxml2' C library.
2214
License: MIT + file LICENSE
2315
URL: https://xml2.r-lib.org/, https://github.com/r-lib/xml2
2416
BugReports: https://github.com/r-lib/xml2/issues
@@ -37,11 +29,11 @@ Suggests:
3729
testthat (>= 2.1.0)
3830
VignetteBuilder:
3931
knitr
32+
Config/Needs/website: tidyverse/tidytemplate
4033
Encoding: UTF-8
4134
Roxygen: list(markdown = TRUE)
42-
RoxygenNote: 7.1.1
43-
SystemRequirements: libxml2: libxml2-dev (deb), libxml2-devel
44-
(rpm)
35+
RoxygenNote: 7.1.2
36+
SystemRequirements: libxml2: libxml2-dev (deb), libxml2-devel (rpm)
4537
Collate:
4638
'S4.R'
4739
'as_list.R'

0 commit comments

Comments
 (0)