Skip to content

Commit

Permalink
Workflow updates (#358)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
hadley authored Feb 28, 2022
1 parent f0a0f35 commit ab20789
Show file tree
Hide file tree
Showing 11 changed files with 162 additions and 292 deletions.
51 changes: 27 additions & 24 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# NOTE: This workflow is overkill for most R packages and
# check-standard.yaml is likely a better choice.
# usethis::use_github_action("check-standard") will install it.
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

Expand All @@ -14,15 +22,19 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}

- {os: windows-latest, r: 'release'}
- {os: windows-2022, r: 'devel'}
- {os: windows-2022, r: 'devel-ucrt'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-18.04, r: '3.4'}
- {os: ubuntu-18.04, r: '3.5'}
- {os: ubuntu-18.04, r: '3.6'}
- {os: ubuntu-18.04, r: '4.0'}
- {os: ubuntu-18.04, r: '4.1'}
# Use 3.6 to trigger usage of RTools35
- {os: windows-latest, r: '3.6'}

# Use older ubuntu to maximise backward compatibility
- {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-18.04, r: 'release'}
- {os: ubuntu-18.04, r: 'oldrel-1'}
- {os: ubuntu-18.04, r: 'oldrel-2'}
- {os: ubuntu-18.04, r: 'oldrel-3'}
- {os: ubuntu-18.04, r: 'oldrel-4'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -31,28 +43,19 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck

- uses: r-lib/actions/check-r-package@HEAD

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
extra-packages: any::rcmdcheck
needs: check

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
upload-snapshots: true
58 changes: 30 additions & 28 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,46 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: master
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: macOS-latest
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-pandoc@master

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
shell: Rscript {0}
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

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

- name: Install dependencies
run: |
install.packages("remotes")
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("pkgdown")
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Deploy package
run: |
install.packages('xslt')
pkgdown::deploy_to_branch(new_process = FALSE)
shell: Rscript {0}
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
67 changes: 47 additions & 20 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,79 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
issue_comment:
types: [created]

name: Commands

jobs:
document:
if: startsWith(github.event.comment.body, '/document')
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
name: document
runs-on: macOS-latest
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@master

- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@master
- name: Install dependencies
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)'

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::roxygen2
needs: pr-document

- name: Document
run: Rscript -e 'roxygen2::roxygenise()'
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add man/\* NAMESPACE
git commit -m 'Document'
- uses: r-lib/actions/pr-push@master
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

style:
if: startsWith(github.event.comment.body, '/style')
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
name: style
runs-on: macOS-latest
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@master

- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@master

- uses: r-lib/actions/setup-r@v2

- name: Install dependencies
run: Rscript -e 'install.packages("styler")'
run: install.packages("styler")
shell: Rscript {0}

- name: Style
run: Rscript -e 'styler::style_pkg()'
run: styler::style_pkg()
shell: Rscript {0}

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add \*.R
git commit -m 'Style'
- uses: r-lib/actions/pr-push@master
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# A mock job just to ensure we have a successful build status
finish:
runs-on: ubuntu-latest
steps:
- run: true
42 changes: 15 additions & 27 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,31 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- master
branches: [main, master]
pull_request:
branches:
- master
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: macOS-latest
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master

- uses: r-lib/actions/setup-pandoc@master

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v1
- uses: r-lib/actions/setup-r@v2
with:
path: ${{ env.R_LIBS_USER }}
key: macOS-r-4.0-2-${{ hashFiles('depends.Rds') }}
restore-keys: macOS-r-4.0-2-
use-public-rspm: true

- name: Install dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: covr::codecov()
run: covr::codecov(quiet = FALSE)
shell: Rscript {0}
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

34 changes: 13 additions & 21 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
Package: xml2
Title: Parse XML
Version: 1.3.3.9000
Authors@R:
c(person(given = "Hadley",
family = "Wickham",
role = c("aut", "cre"),
email = "[email protected]"),
person(given = "Jim",
family = "Hester",
role = "aut"),
person(given = "Jeroen",
family = "Ooms",
role = "aut"),
person(given = "RStudio",
role = "cph"),
person(given = "R Foundation",
role = "ctb",
comment = "Copy of R-project homepage cached as example"))
Description: Work with XML files using a simple, consistent
interface. Built on top of the 'libxml2' C library.
Authors@R: c(
person("Hadley", "Wickham", , "[email protected]", role = c("aut", "cre")),
person("Jim", "Hester", role = "aut"),
person("Jeroen", "Ooms", role = "aut"),
person("RStudio", role = c("cph", "fnd")),
person("R Foundation", role = "ctb",
comment = "Copy of R-project homepage cached as example")
)
Description: Work with XML files using a simple, consistent interface.
Built on top of the 'libxml2' C library.
License: MIT + file LICENSE
URL: https://xml2.r-lib.org/, https://github.com/r-lib/xml2
BugReports: https://github.com/r-lib/xml2/issues
Expand All @@ -37,11 +29,11 @@ Suggests:
testthat (>= 2.1.0)
VignetteBuilder:
knitr
Config/Needs/website: tidyverse/tidytemplate
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1
SystemRequirements: libxml2: libxml2-dev (deb), libxml2-devel
(rpm)
RoxygenNote: 7.1.2
SystemRequirements: libxml2: libxml2-dev (deb), libxml2-devel (rpm)
Collate:
'S4.R'
'as_list.R'
Expand Down
Loading

0 comments on commit ab20789

Please sign in to comment.