Skip to content

Update R-CMD-check.yaml #35

Update R-CMD-check.yaml

Update R-CMD-check.yaml #35

Workflow file for this run

on:
push:
branches:
- master
pull_request:
branches:
- master
name: R-CMD-check
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: '3.6'}
- {os: windows-latest, r: '4.3'}
- {os: windows-latest, r: 'devel'}
- {os: macOS-latest, r: '3.6'}
- {os: macOS-latest, r: '4.3'}
- {os: macOS-latest, r: 'devel'}
- {os: ubuntu-22.04, r: '3.6', rspm: "https://demo.rstudiopm.com/all/__linux__/jammy/latest"}
- {os: ubuntu-22.04, r: '4.3', rspm: "https://demo.rstudiopm.com/all/__linux__/jammy/latest"}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
TZ: UTC
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup R from r-lib
if: runner.os != 'ubuntu-22.04'
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
- name: Setup pandoc from r-lib
if: runner.os != 'ubuntu-22.04'
uses: r-lib/actions/setup-pandoc@v2
- name: Install R packages for CI
run: |
install.packages('remotes')
remotes::install_github('r-hub/sysreqs')
shell: Rscript {0}
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}
- name: Restore R package cache
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os != 'ubuntu-22.04'"
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r-${{ matrix.config.r }}-
- name: Cache R packages on Linux
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os == 'ubuntu-22.04' "
uses: actions/cache@v3
with:
path: /home/runner/work/_temp/Library
key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r-${{ matrix.config.r }}-
- name: Install system dependencies
if: runner.os == 'ubuntu-22.04'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install R dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("covr")
shell: Rscript {0}
- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- name: Run CMD check
env:
_R_CHECK_CRAN_INCOMING_: false
DISPLAY: 99.0
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check")
shell: Rscript {0}
- name: Reveal testthat details
if: env.has_testthat == 'true'
run: find . -name testthat.Rout -exec cat '{}' ';'
- name: Test coverage
if: github.ref == 'refs/heads/master' && env.run_covr == 'true' && runner.os == 'ubuntu-22.04'
run: |
covr::codecov(coverage = covr::package_coverage(type = "all"))
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: Install package
run: |
R CMD INSTALL .
git config --global user.name ${{secrets.GH_USER}}
git config --global user.email ${{secrets.GH_EMAIL}}
- name: Deploy Pkgdown to branch
run: pkgdown::deploy_to_branch(new_process = FALSE)
shell: Rscript {0}