Skip to content

Commit a4ccf8d

Browse files
committed
updated github action
1 parent 5c97ad1 commit a4ccf8d

File tree

1 file changed

+23
-58
lines changed

1 file changed

+23
-58
lines changed

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

Lines changed: 23 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
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/v2/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-
- main
7-
- master
5+
branches: [main, master]
86
pull_request:
9-
branches:
10-
- main
11-
- master
127

13-
name: R-CMD-check
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
1411

1512
jobs:
1613
R-CMD-check:
@@ -22,65 +19,33 @@ jobs:
2219
fail-fast: false
2320
matrix:
2421
config:
22+
- {os: macos-latest, r: 'release'}
2523
- {os: windows-latest, r: 'release'}
26-
- {os: macOS-latest, r: 'release'}
27-
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
28-
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
24+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
25+
- {os: ubuntu-latest, r: 'release'}
26+
- {os: ubuntu-latest, r: 'oldrel-1'}
2927

3028
env:
31-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
32-
RSPM: ${{ matrix.config.rspm }}
3329
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
30+
R_KEEP_PKG_SOURCE: yes
3431

3532
steps:
36-
- uses: actions/checkout@v2
33+
- uses: actions/checkout@v4
34+
35+
- uses: r-lib/actions/setup-pandoc@v2
3736

38-
- uses: r-lib/actions/setup-r@v1
37+
- uses: r-lib/actions/setup-r@v2
3938
with:
4039
r-version: ${{ matrix.config.r }}
40+
http-user-agent: ${{ matrix.config.http-user-agent }}
41+
use-public-rspm: true
4142

42-
- uses: r-lib/actions/setup-pandoc@v1
43-
44-
- name: Query dependencies
45-
run: |
46-
install.packages('remotes')
47-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
48-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
49-
shell: Rscript {0}
50-
51-
- name: Cache R packages
52-
if: runner.os != 'Windows'
53-
uses: actions/cache@v2
43+
- uses: r-lib/actions/setup-r-dependencies@v2
5444
with:
55-
path: ${{ env.R_LIBS_USER }}
56-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
57-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
58-
59-
- name: Install system dependencies
60-
if: runner.os == 'Linux'
61-
run: |
62-
while read -r cmd
63-
do
64-
eval sudo $cmd
65-
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
66-
67-
- name: Install dependencies
68-
run: |
69-
remotes::install_deps(dependencies = TRUE)
70-
remotes::install_cran("rcmdcheck")
71-
shell: Rscript {0}
72-
73-
- name: Check
74-
env:
75-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
76-
run: |
77-
options(crayon.enabled = TRUE)
78-
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
79-
shell: Rscript {0}
45+
extra-packages: any::rcmdcheck
46+
needs: check
8047

81-
- name: Upload check results
82-
if: failure()
83-
uses: actions/upload-artifact@main
48+
- uses: r-lib/actions/check-r-package@v2
8449
with:
85-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
86-
path: check
50+
upload-snapshots: true
51+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

0 commit comments

Comments
 (0)