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
33on :
44 push :
5+ branches : [main, master]
56 pull_request :
7+ branches : [main, master]
68
79name : R-CMD-check
810
@@ -16,61 +18,34 @@ jobs:
1618 fail-fast : false
1719 matrix :
1820 config :
21+ - {os: macos-latest, r: 'release'}
1922 - {os: windows-latest, r: 'release'}
20- - {os: macOS-latest, r: 'release'}
21- - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
22- - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
23+ - {os: windows-latest, r: '4.1'}
24+ - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
25+ - {os: ubuntu-latest, r: 'release'}
26+ - {os: ubuntu-latest, r: 'oldrel-1'}
2327
2428 env :
25- R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
26- RSPM : ${{ matrix.config.rspm }}
2729 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
30+ R_KEEP_PKG_SOURCE : yes
2831
2932 steps :
30- - uses : actions/checkout@v2
33+ - uses : actions/checkout@v3
34+
35+ - if : runner.os == 'Linux'
36+ run : sudo apt-get install -y libzmq3-dev
3137
32- - uses : r-lib/actions/setup-r@v1
38+ - uses : r-lib/actions/setup-r@v2
3339 with :
3440 r-version : ${{ matrix.config.r }}
41+ http-user-agent : ${{ matrix.config.http-user-agent }}
42+ use-public-rspm : true
3543
36- - uses : r-lib/actions/setup-pandoc@v1
37-
38- - name : Query dependencies
39- run : |
40- install.packages('remotes')
41- saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
42- writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
43- shell : Rscript {0}
44-
45- - name : Restore R package cache
46- if : runner.os != 'Windows'
47- uses : actions/cache@v2
44+ - uses : r-lib/actions/setup-r-dependencies@v2
4845 with :
49- path : ${{ env.R_LIBS_USER }}
50- key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
51- restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
52-
53- - name : Install system dependencies
54- if : runner.os != 'Windows'
55- run : if [ "$RUNNER_OS" == "Linux" ]; then sudo apt-get install -y libzmq3-dev; else brew install zeromq; fi
56-
57- - name : Install dependencies
58- run : |
59- remotes::install_deps(dependencies = TRUE)
60- remotes::install_cran("rcmdcheck")
61- shell : Rscript {0}
62-
63- - name : Check
64- env :
65- _R_CHECK_CRAN_INCOMING_REMOTE_ : false
66- run : |
67- options(crayon.enabled = TRUE)
68- rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
69- shell : Rscript {0}
46+ extra-packages : any::rcmdcheck
47+ needs : check
7048
71- - name : Upload check results
72- if : failure()
73- uses : actions/upload-artifact@main
49+ - uses : r-lib/actions/check-r-package@v2
7450 with :
75- name : ${{ runner.os }}-r${{ matrix.config.r }}-results
76- path : check
51+ upload-snapshots : true
0 commit comments