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.
4+ #
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
17on :
28 push :
39 branches :
10+ - main
411 - master
512 pull_request :
613 branches :
14+ - main
715 - master
816
917name : R-CMD-check
@@ -21,58 +29,53 @@ jobs:
2129 - {os: macOS-latest, r: 'release'}
2230 - {os: windows-latest, r: 'release'}
2331 - {os: windows-latest, r: '3.6'}
24- - {os: ubuntu-16.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest", http-user-agent: "R/4.0.0 (ubuntu-16.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
25- - {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
26- - {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
27- - {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
32+ - {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.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"}
2834
2935 env :
30- R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
3136 RSPM : ${{ matrix.config.rspm }}
3237 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
3338
3439 steps :
3540 - uses : actions/checkout@v2
3641
37- - uses : r-lib/actions/setup-r@master
42+ - uses : r-lib/actions/setup-r@v1
43+ id : install-r
3844 with :
3945 r-version : ${{ matrix.config.r }}
4046 http-user-agent : ${{ matrix.config.http-user-agent }}
4147
42- - uses : r-lib/actions/setup-pandoc@master
48+ - uses : r-lib/actions/setup-pandoc@v1
4349
44- - name : Query dependencies
50+ - name : Install pak and query dependencies
4551 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")
52+ install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
53+ saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
4954 shell : Rscript {0}
5055
51- - name : Cache R packages
52- if : runner.os != 'Windows'
53- uses : actions/cache@v1
56+ - name : Restore R package cache
57+ uses : actions/cache@v2
5458 with :
5559 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-
60+ key : ${{ matrix.config. os }}-${{ steps.install-r.outputs.installed-r- version }}-1-${{ hashFiles('.github/r- depends.rds ') }}
61+ restore-keys : ${{ matrix.config. os }}-${{ steps.install-r.outputs.installed-r- version }}-1-
5862
5963 - name : Install system dependencies
6064 if : runner.os == 'Linux'
6165 run : |
62- while read -r cmd
63- do
64- eval sudo $cmd
65- done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "16.04"), sep = "\n")')
66+ pak::local_system_requirements(execute = TRUE)
67+ pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
68+ shell : Rscript {0}
6669
6770 - name : Install dependencies
6871 run : |
69- remotes::install_deps(dependencies = TRUE)
70- remotes::install_cran ("rcmdcheck")
72+ pak::local_install_dev_deps(upgrade = TRUE)
73+ pak::pkg_install ("rcmdcheck")
7174 shell : Rscript {0}
7275
7376 - name : Install Miniconda
7477 run : |
75- Rscript -e "remotes::install_github ('rstudio/reticulate')"
78+ Rscript -e "pak::pkg_install ('rstudio/reticulate')"
7679 Rscript -e "reticulate::install_miniconda()"
7780
7881 - name : Find Miniconda on macOS
8386 run : |
8487 reticulate::conda_create('r-reticulate', packages = c('python==3.6.9'))
8588 tensorflow::install_tensorflow(version='1.14.0')
86- shell : Rscript {0}
89+ shell : Rscript {0}
8790
8891 - name : Session info
8992 run : |
9598 - name : Check
9699 env :
97100 _R_CHECK_CRAN_INCOMING_ : false
98- run : rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
101+ run : |
102+ options(crayon.enabled = TRUE)
103+ rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
99104 shell : Rscript {0}
100105
101106 - name : Show testthat output
@@ -107,5 +112,5 @@ jobs:
107112 if : failure()
108113 uses : actions/upload-artifact@main
109114 with :
110- name : ${{ runner .os }}-r${{ matrix.config.r }}-results
115+ name : ${{ matrix.config .os }}-r${{ matrix.config.r }}-results
111116 path : check
0 commit comments