Merge pull request #87 from YoungjunNa/master #62
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 | |
pull_request: | |
branches: | |
- master | |
name: R-CMD-check | |
# Increment this version when we want to clear cache | |
env: | |
cache-version: v6 | |
jobs: | |
R-CMD-check: | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: windows-latest, r: '4.1', vdiffr: true, xref: true} | |
- {os: macOS-latest, r: '4.1', vdiffr: true, xref: true} | |
- {os: ubuntu-18.04, r: 'devel', vdiffr: false, xref: true} | |
- {os: ubuntu-18.04, r: '4.1', vdiffr: true, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} | |
- {os: ubuntu-18.04, r: '4.0', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} | |
- {os: ubuntu-18.04, r: '3.6', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} | |
- {os: ubuntu-18.04, r: '3.5', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} | |
- {os: ubuntu-18.04, r: '3.4', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} | |
- {os: ubuntu-18.04, r: '3.3', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/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 | |
# Some packages might unavailable on the older versions, so let's ignore xref warnings | |
_R_CHECK_RD_XREFS_: ${{ matrix.config.xref }} | |
# Runs vdiffr test only on the latest version of R | |
VDIFFR_RUN_TESTS: ${{ matrix.config.vdiffr }} | |
VDIFFR_LOG_PATH: "../vdiffr.Rout.fail" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-r@master | |
with: | |
r-version: ${{ matrix.config.r }} | |
http-user-agent: ${{ matrix.config.http-user-agent }} | |
- uses: r-lib/actions/setup-pandoc@master | |
- 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: | | |
while read -r cmd | |
do | |
eval sudo $cmd | |
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "18.04"))') | |
- name: Install system dependencies on macOS | |
if: runner.os == 'macOS' | |
run: | | |
# XQuartz is needed by vdiffr | |
brew install xquartz | |
# Use only binary packages | |
echo 'options(pkgType = "binary")' >> ~/.Rprofile | |
- name: Install dependencies | |
run: | | |
remotes::install_deps(dependencies = TRUE) | |
remotes::install_cran("rcmdcheck") | |
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 |