Skip to content

Use pak in R-CMD-check.yaml #4697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 27 additions & 53 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ on:

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 }}
Expand All @@ -29,18 +25,13 @@ jobs:
- {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: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: '3.3', vdiffr: false, xref: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: '4.1', vdiffr: true, xref: true}
- {os: ubuntu-18.04, r: '4.0', vdiffr: false, xref: true}
- {os: ubuntu-18.04, r: '3.6', vdiffr: false, xref: true}
- {os: ubuntu-18.04, r: '3.5', vdiffr: false, xref: true}
- {os: ubuntu-18.04, r: '3.4', vdiffr: false, xref: false}

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
Expand All @@ -50,54 +41,37 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
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}
use-public-rspm: true

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
- uses: r-lib/actions/setup-r-dependencies@v2
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 }}-
cache-version: 7
extra-packages: |
any::rcmdcheck
maps=?ignore-before-r=3.5.0
Hmisc=?ignore-before-r=3.6.0
mapproj=?ignore-before-r=3.5.0
multcomp=?ignore-before-r=3.5.0
quantreg=?ignore-before-r=3.5.0
interp=?ignore-before-r=3.5.0

- 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}
- uses: r-lib/actions/check-r-package@v2
env:
_R_CHECK_FORCE_SUGGESTS_: false

- name: Check
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check")
shell: Rscript {0}
- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check