Update R-CMD-check.yaml #44
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 | |
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-latest, r: '3.6', rspm: "https://demo.rstudiopm.com/all/__linux__/jammy/latest"} | |
- {os: ubuntu-latest, 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@v4 | |
- name: Setup R from r-lib | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
r-version: ${{ matrix.config.r }} | |
http-user-agent: ${{ matrix.config.http-user-agent }} | |
- name: Setup pandoc from r-lib | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Query dependencies from r-lib | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::rcmdcheck | |
needs: check | |
- name: Query dependencies from r-lib (Linux) | |
if: runner.os == 'Linux' && runner.r == '4.3' | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::pkgdown, any::covr, local::. | |
needs: website, coverage | |
- name: Restore R package cache | |
if: "!contains(github.event.head_commit.message, '/nocache') && runner.os != 'Linux'" | |
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 == 'Linux' " | |
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: Session info | |
run: | | |
options(width = 100) | |
pkgs <- installed.packages()[, "Package"] | |
sessioninfo::session_info(pkgs, include_base = TRUE) | |
shell: Rscript {0} | |
- name: Run CMD check from r-lib | |
uses: r-lib/actions/check-r-package@v2 | |
with: | |
upload-snapshots: true | |
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' | |
- name: Test coverage | |
if: runner.os == 'Linux' && runner.r == '4.3' | |
run: | | |
covr::codecov( | |
quiet = FALSE, | |
clean = FALSE, | |
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") | |
) | |
shell: Rscript {0} | |
- name: Show testthat output | |
if: always() | |
run: | | |
## -------------------------------------------------------------------- | |
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true | |
shell: bash | |
- name: Upload check results | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-test-failures | |
path: ${{ runner.temp }}/package | |
- name: Build with Pkgdown | |
if: runner.os == 'Linux' && runner.r == '4.3' | |
run: pkgdown::deploy_to_branch(new_process = FALSE, install = FALSE) | |
shell: Rscript {0} | |
- name: Deploy to GitHub pages 🚀 | |
if: runner.os == 'Linux' && runner.r == '4.3' | |
uses: JamesIves/[email protected] | |
with: | |
clean: false | |
branch: gh-pages | |
folder: docs |