Skip to content

Commit 873f7cc

Browse files
committed
Update GHA
1 parent cd5f2f9 commit 873f7cc

File tree

2 files changed

+33
-70
lines changed

2 files changed

+33
-70
lines changed

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

Lines changed: 20 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2-
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
1+
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches:
6-
- master
5+
branches: [main, master]
76
pull_request:
8-
branches:
9-
- master
7+
branches: [main, master]
108

119
name: R-CMD-check
1210

@@ -20,58 +18,36 @@ jobs:
2018
fail-fast: false
2119
matrix:
2220
config:
21+
- {os: macOS-latest, r: 'release'}
2322
- {os: windows-latest, r: 'release'}
24-
- {os: macOS-latest, r: 'release'}
25-
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
26-
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
23+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
24+
- {os: ubuntu-latest, r: 'release'}
2725

2826
env:
29-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
30-
RSPM: ${{ matrix.config.rspm }}
27+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
28+
R_KEEP_PKG_SOURCE: yes
3129

3230
steps:
3331
- uses: actions/checkout@v2
3432

33+
- uses: r-lib/actions/setup-pandoc@master
34+
3535
- uses: r-lib/actions/setup-r@master
3636
with:
3737
r-version: ${{ matrix.config.r }}
38+
http-user-agent: ${{ matrix.config.http-user-agent }}
39+
use-public-rspm: true
3840

39-
- uses: r-lib/actions/setup-pandoc@master
40-
41-
- name: Query dependencies
42-
run: |
43-
install.packages('remotes')
44-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
45-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
46-
shell: Rscript {0}
47-
48-
- name: Cache R packages
49-
if: runner.os != 'Windows'
50-
uses: actions/cache@v1
41+
- uses: r-lib/actions/setup-r-dependencies@master
5142
with:
52-
path: ${{ env.R_LIBS_USER }}
53-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2-${{ hashFiles('.github/depends.Rds') }}
54-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2-
55-
56-
- name: Install system dependencies
57-
if: runner.os == 'Linux'
58-
run: |
59-
while read -r cmd
60-
do
61-
eval sudo $cmd
62-
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
43+
extra-packages: rcmdcheck
6344

64-
- name: Install dependencies
65-
run: |
66-
remotes::install_deps(dependencies = TRUE)
67-
remotes::install_cran("rcmdcheck")
68-
shell: Rscript {0}
45+
- uses: r-lib/actions/check-r-package@master
6946

70-
- name: Check
71-
env:
72-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
73-
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
74-
shell: Rscript {0}
47+
- name: Show testthat output
48+
if: always()
49+
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
50+
shell: bash
7551

7652
- name: Upload check results
7753
if: failure()

.github/workflows/pkgdown.yaml

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,33 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/master/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+
tags: ['*']
47

58
name: pkgdown
69

710
jobs:
811
pkgdown:
9-
runs-on: macOS-latest
12+
runs-on: ubuntu-latest
1013
env:
1114
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1215
steps:
1316
- uses: actions/checkout@v2
1417

15-
- uses: r-lib/actions/setup-r@master
16-
1718
- uses: r-lib/actions/setup-pandoc@master
1819

19-
- name: Query dependencies
20-
run: |
21-
install.packages('remotes')
22-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
23-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
24-
shell: Rscript {0}
25-
26-
- name: Cache R packages
27-
uses: actions/cache@v1
20+
- uses: r-lib/actions/setup-r@master
2821
with:
29-
path: ${{ env.R_LIBS_USER }}
30-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
31-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
32-
33-
- name: Install dependencies
34-
run: |
35-
remotes::install_deps(dependencies = TRUE)
36-
install.packages("pkgdown")
37-
shell: Rscript {0}
22+
use-public-rspm: true
3823

39-
- name: Install package
40-
run: R CMD INSTALL .
24+
- uses: r-lib/actions/setup-r-dependencies@master
25+
with:
26+
extra-packages: pkgdown
27+
needs: website
4128

4229
- name: Deploy package
4330
run: |
44-
git config --local user.email "[email protected]"
45-
git config --local user.name "GitHub Actions"
31+
git config --local user.name "$GITHUB_ACTOR"
32+
git config --local user.email "[email protected]"
4633
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

0 commit comments

Comments
 (0)