Skip to content

Commit 5b844c9

Browse files
committed
Update github actions
1 parent 116df2b commit 5b844c9

File tree

5 files changed

+112
-177
lines changed

5 files changed

+112
-177
lines changed

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

Lines changed: 28 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
# NOTE: This workflow is overkill for most R packages
2-
# check-standard.yaml is likely a better choice
3-
# usethis::use_github_action("check-standard") will install it.
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
43
#
5-
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
6-
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
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.
77
on:
88
push:
9-
branches:
10-
- main
11-
- master
9+
branches: [main, master]
1210
pull_request:
13-
branches:
14-
- main
15-
- master
11+
branches: [main, master]
1612

1713
name: R-CMD-check
1814

@@ -27,86 +23,39 @@ jobs:
2723
matrix:
2824
config:
2925
- {os: macOS-latest, r: 'release'}
26+
3027
- {os: windows-latest, r: 'release'}
31-
- {os: windows-latest, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/latest"}
32-
- {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.1.0 (ubuntu-18.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
33-
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
34-
- {os: ubuntu-18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
35-
- {os: ubuntu-18.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
36-
- {os: ubuntu-18.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
37-
- {os: ubuntu-18.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
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'}
3838

3939
env:
40-
RSPM: ${{ matrix.config.rspm }}
4140
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
41+
R_KEEP_PKG_SOURCE: yes
4242

4343
steps:
4444
- uses: actions/checkout@v2
4545

46-
- uses: r-lib/actions/setup-r@v1
47-
id: install-r
46+
- uses: r-lib/actions/setup-pandoc@v2
47+
48+
- uses: r-lib/actions/setup-r@v2
4849
with:
4950
r-version: ${{ matrix.config.r }}
5051
http-user-agent: ${{ matrix.config.http-user-agent }}
52+
use-public-rspm: true
5153

52-
- uses: r-lib/actions/setup-pandoc@v1
53-
54-
- name: Install pak and query dependencies
55-
run: |
56-
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
57-
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
58-
shell: Rscript {0}
59-
60-
- name: Restore R package cache
61-
uses: actions/cache@v2
54+
- uses: r-lib/actions/setup-r-dependencies@v2
6255
with:
63-
path: |
64-
${{ env.R_LIBS_USER }}/*
65-
!${{ env.R_LIBS_USER }}/pak
66-
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
67-
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
56+
extra-packages: any::rcmdcheck
57+
needs: check
6858

69-
- name: Install system dependencies
70-
if: runner.os == 'Linux'
71-
run: |
72-
pak::local_system_requirements(execute = TRUE)
73-
pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
74-
shell: Rscript {0}
75-
76-
- name: Install dependencies
77-
run: |
78-
pak::local_install_dev_deps(upgrade = TRUE)
79-
pak::pkg_install("rcmdcheck")
80-
shell: Rscript {0}
81-
82-
- name: Session info
83-
run: |
84-
options(width = 100)
85-
pkgs <- installed.packages()[, "Package"]
86-
sessioninfo::session_info(pkgs, include_base = TRUE)
87-
shell: Rscript {0}
88-
89-
- name: Check
90-
env:
91-
_R_CHECK_CRAN_INCOMING_: false
92-
run: |
93-
options(crayon.enabled = TRUE)
94-
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
95-
shell: Rscript {0}
96-
97-
- name: Show testthat output
98-
if: always()
99-
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
100-
shell: bash
101-
102-
- name: Upload check results
103-
if: failure()
104-
uses: actions/upload-artifact@main
59+
- uses: r-lib/actions/check-r-package@v2
10560
with:
106-
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
107-
path: check
108-
109-
- name: Don't use tar from old Rtools to store the cache
110-
if: ${{ runner.os == 'Windows' && startsWith(steps.install-r.outputs.installed-r-version, '3.6' ) }}
111-
shell: bash
112-
run: echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH
61+
upload-snapshots: true

.github/workflows/pkgdown.yaml

Lines changed: 28 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +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:
4-
- main
5-
- master
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
611

712
name: pkgdown
813

914
jobs:
1015
pkgdown:
11-
runs-on: ubuntu-18.04
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 }}
1220
env:
13-
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest
1421
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
15-
1622
steps:
1723
- uses: actions/checkout@v2
1824

19-
- uses: r-lib/actions/setup-r@v1
20-
id: install-r
21-
22-
- uses: r-lib/actions/setup-pandoc@v1
23-
24-
- name: Install pak and query dependencies
25-
run: |
26-
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
27-
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
28-
shell: Rscript {0}
25+
- uses: r-lib/actions/setup-pandoc@v2
2926

30-
- name: Restore R package cache
31-
uses: actions/cache@v2
27+
- uses: r-lib/actions/setup-r@v2
3228
with:
33-
path: |
34-
${{ env.R_LIBS_USER }}/*
35-
!${{ env.R_LIBS_USER }}/pak
36-
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
37-
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-
29+
use-public-rspm: true
3830

39-
- name: Install system dependencies
40-
if: runner.os == 'Linux'
41-
run: |
42-
pak::local_system_requirements(execute = TRUE)
43-
pak::pkg_system_requirements("pkgdown", execute = TRUE)
44-
shell: Rscript {0}
31+
- uses: r-lib/actions/setup-r-dependencies@v2
32+
with:
33+
extra-packages: any::pkgdown, local::.
34+
needs: website
4535

46-
- name: Install dependencies
47-
run: |
48-
pak::local_install_dev_deps(upgrade = TRUE, dependencies = c("all", "Config/Needs/website"))
49-
pak::pkg_install("pkgdown")
36+
- name: Build site
37+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
5038
shell: Rscript {0}
5139

52-
- name: Install package
53-
run: R CMD INSTALL .
54-
55-
- name: Build and deploy pkgdown site
56-
run: |
57-
git config --local user.name "$GITHUB_ACTOR"
58-
git config --local user.email "[email protected]"
59-
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
40+
- name: Deploy to GitHub pages 🚀
41+
if: github.event_name != 'pull_request'
42+
uses: JamesIves/[email protected]
43+
with:
44+
clean: false
45+
branch: gh-pages
46+
folder: docs

.github/workflows/pr-commands.yaml

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +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
1014
env:
1115
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1216
steps:
1317
- uses: actions/checkout@v2
14-
- uses: r-lib/actions/pr-fetch@v1
18+
19+
- uses: r-lib/actions/pr-fetch@v2
1520
with:
1621
repo-token: ${{ secrets.GITHUB_TOKEN }}
17-
- uses: r-lib/actions/setup-r@v1
18-
- name: Install dependencies
19-
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+
2032
- name: Document
21-
run: Rscript -e 'roxygen2::roxygenise()'
33+
run: roxygen2::roxygenise()
34+
shell: Rscript {0}
35+
2236
- name: commit
2337
run: |
24-
git config --local user.email "[email protected]"
25-
git config --local user.name "GitHub Actions"
38+
git config --local user.name "$GITHUB_ACTOR"
39+
git config --local user.email "[email protected]"
2640
git add man/\* NAMESPACE
2741
git commit -m 'Document'
28-
- uses: r-lib/actions/pr-push@v1
42+
43+
- uses: r-lib/actions/pr-push@v2
2944
with:
3045
repo-token: ${{ secrets.GITHUB_TOKEN }}
46+
3147
style:
32-
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') }}
3349
name: style
34-
runs-on: macOS-latest
50+
runs-on: ubuntu-latest
3551
env:
3652
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3753
steps:
3854
- uses: actions/checkout@v2
39-
- uses: r-lib/actions/pr-fetch@v1
55+
56+
- uses: r-lib/actions/pr-fetch@v2
4057
with:
4158
repo-token: ${{ secrets.GITHUB_TOKEN }}
42-
- uses: r-lib/actions/setup-r@v1
59+
60+
- uses: r-lib/actions/setup-r@v2
61+
4362
- name: Install dependencies
44-
run: Rscript -e 'install.packages("styler")'
63+
run: install.packages("styler")
64+
shell: Rscript {0}
65+
4566
- name: Style
46-
run: Rscript -e 'styler::style_pkg()'
67+
run: styler::style_pkg()
68+
shell: Rscript {0}
69+
4770
- name: commit
4871
run: |
49-
git config --local user.email "[email protected]"
50-
git config --local user.name "GitHub Actions"
72+
git config --local user.name "$GITHUB_ACTOR"
73+
git config --local user.email "[email protected]"
5174
git add \*.R
5275
git commit -m 'Style'
53-
- uses: r-lib/actions/pr-push@v1
76+
77+
- uses: r-lib/actions/pr-push@v2
5478
with:
5579
repo-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +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-
- main
5-
- master
5+
branches: [main, master]
66
pull_request:
7-
branches:
8-
- main
9-
- master
7+
branches: [main, master]
108

119
name: test-coverage
1210

1311
jobs:
1412
test-coverage:
15-
runs-on: ubuntu-18.04
13+
runs-on: ubuntu-latest
1614
env:
17-
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest
1815
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1916

2017
steps:
2118
- uses: actions/checkout@v2
2219

23-
- uses: r-lib/actions/setup-r@v1
24-
id: install-r
25-
26-
- name: Install pak and query dependencies
27-
run: |
28-
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
29-
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
30-
shell: Rscript {0}
31-
32-
- name: Restore R package cache
33-
uses: actions/cache@v2
20+
- uses: r-lib/actions/setup-r@v2
3421
with:
35-
path: |
36-
${{ env.R_LIBS_USER }}/*
37-
!${{ env.R_LIBS_USER }}/pak
38-
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
39-
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-
22+
use-public-rspm: true
4023

41-
- name: Install system dependencies
42-
if: runner.os == 'Linux'
43-
run: |
44-
pak::local_system_requirements(execute = TRUE)
45-
pak::pkg_system_requirements("covr", execute = TRUE)
46-
shell: Rscript {0}
47-
48-
- name: Install dependencies
49-
run: |
50-
pak::local_install_dev_deps(upgrade = TRUE)
51-
pak::pkg_install("covr")
52-
shell: Rscript {0}
24+
- uses: r-lib/actions/setup-r-dependencies@v2
25+
with:
26+
extra-packages: any::covr
27+
needs: coverage
5328

5429
- name: Test coverage
55-
run: covr::codecov()
30+
run: covr::codecov(quiet = FALSE)
5631
shell: Rscript {0}

0 commit comments

Comments
 (0)