NEWS/version #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
- rc | |
pull_request: | |
branches: | |
- master | |
- development | |
name: R-CMD-check | |
# Increment this version when we want to clear cache | |
env: | |
cache-version: v1 | |
jobs: | |
R-CMD-check: | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: ubuntu-20.04, r: 'devel' } | |
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} | |
- {os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
RSPM: ${{ matrix.config.rspm }} | |
# don't treat missing suggested packages as error | |
_R_CHECK_FORCE_SUGGESTS_: false | |
# trick CMD check into checking subdirs, which then whitelists | |
# non-CRAN packages | |
_R_CHECK_PACKAGES_USED_IN_TESTS_USE_SUBDIRS_: true | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r }} | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Query dependencies | |
run: | | |
install.packages('remotes') | |
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2) | |
shell: Rscript {0} | |
- name: Cache R packages | |
if: runner.os != 'Windows' | |
uses: actions/cache@v1 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }} | |
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r-${{ matrix.config.r }}- | |
- name: Install system dependencies on Linux | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get install libcurl4-openssl-dev | |
while read -r cmd | |
do | |
eval sudo $cmd | |
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') | |
- name: Install dependencies | |
run: | | |
remotes::install_deps(dependencies = TRUE) | |
remotes::install_cran("rcmdcheck") | |
remotes::install_cran("covr") | |
shell: Rscript {0} | |
- name: Check | |
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check") | |
shell: Rscript {0} | |
- name: Upload check results | |
if: failure() | |
uses: actions/upload-artifact@master | |
with: | |
name: ${{ runner.os }}-r${{ matrix.config.r }}-results | |
path: check | |
- name: Test coverage | |
# Only run cov on rc so that failure due to small coverage reductions | |
# don't cause the master branch to show as a CI fail. | |
if: github.ref == 'refs/heads/rc' | |
run: covr::codecov() | |
shell: Rscript {0} |