1- name : R CMD Check
21on :
32 push :
4- branches : [main]
3+ branches : [main, master ]
54 pull_request :
6- branches : [main]
5+ release :
6+ types : [published]
7+ workflow_dispatch :
8+
9+ name : R CMD Check
10+
11+ permissions : read-all
712
813jobs :
9- R-CMD-Check :
14+
15+ check-package :
16+
1017 runs-on : ubuntu-latest
18+
19+ # Run checks with R-release, R-devel, and R-oldrelease.
20+ strategy :
21+ # Make sure each job runs independently. When `fail-fast` is true
22+ # (by default) all jobs in the matrix are cancelled as soon as one fails.
23+ fail-fast : false
24+ matrix :
25+ r-version : ['release', 'devel', 'oldrel']
26+
27+ # Override the default job name to display the current R version name in
28+ # parentheses (e.g. "check-package (R-release)").
29+ name : " check-package (R-${{ matrix.r-version }})"
30+
1131 steps :
12- - uses : actions/checkout@v4
13- - name : Set up R
32+ # Pull the latest changes from the repository down to the runner.
33+ - name : Checkout
34+ uses : actions/checkout@v4
35+
36+ # Install R and any system dependencies.
37+ - name : Setup R
1438 uses : r-lib/actions/setup-r@v2
1539 with :
16- r-version : ' 4.5.1' # Match your Docker image’s R version
17- - name : Set RENV_PATHS_ROOT
18- shell : bash
19- run : |
20- echo "RENV_PATHS_ROOT=${{ runner.temp }}/renv" >> $GITHUB_ENV
21- - name : Install and activate renv
22- run : |
23- install.packages("renv")
24- renv::activate()
25- shell : Rscript {0}
26- - name : Get R and OS version
27- id : get-version
28- run : |
29- cat("##[set-output name=os-version;]", sessionInfo()$running, "\n", sep = "")
30- cat("##[set-output name=r-version;]", R.Version()$version.string, sep = "")
31- shell : Rscript {0}
32- - name : Restore Renv package cache
33- uses : actions/cache@v4
40+ # Install the R version specified by the current strategy.
41+ r-version : ${{ matrix.r-version }}
42+ # Use pre-built binaries from Posit's public package manager to
43+ # speed up R dependency installation.
44+ use-public-rspm : true
45+ # Specify additional repositories to pull dependencies not
46+ # available on CRAN (i.e. `BPCells`).
47+ # extra-repositories: 'https://bnprks.r-universe.dev'
48+
49+ # Install R dependencies.
50+ - name : Install Dependencies
51+ uses : r-lib/actions/setup-r-dependencies@v2
3452 with :
35- path : ${{ env.RENV_PATHS_ROOT }}
36- key : ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{ inputs.cache-version }}-${{ hashFiles('renv.lock') }}
37- restore-keys : ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{inputs.cache-version }}-
38- - name : Run R CMD check
39- uses : r-lib/actions/check-r-package@v2
53+ extra-packages :
54+ any::rcmdcheck
55+ any::pkgdown
56+ # Installed packages are cached by default - force an upgrade to the
57+ # latest version of all dependencies.
58+ upgrade : ' TRUE'
59+
60+ # Run CRAN checks - fails if any ERRORs or WARNINGs are raised in which
61+ # case the `rcmdcheck` output will be uploaded as an artifact.
62+ - name : Run Checks
63+ uses : r-lib/actions/check-r-package@v2
64+ env :
65+ _R_CHECK_PKG_SIZES_ : true
66+ _R_CHECK_RD_XREFS_ : true
67+ _R_CHECK_CRAN_INCOMING_NOTE_GNU_MAKE_ : true
68+ _R_CHECK_PACKAGE_DATASETS_SUPPRESS_NOTES_ : true
0 commit comments