forgot dontrun #681
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: | |
workflow_dispatch: | |
workflow_call: | |
inputs: | |
error-on: | |
description: Input for the 'error_on' parameter in rcmdcheck::rcmdcheck() | |
required: false | |
default: note | |
type: string | |
push: | |
branches: | |
- main | |
- devel | |
pull_request: | |
branches: | |
- main | |
- devel | |
name: R CMD Check | |
concurrency: | |
group: r-cmd-check-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
R-CMD-check: | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
if: > | |
!contains(github.event.commits[0].message, '[skip r-cmd-check]') | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: ubuntu-20.04, r: 'release', repos: 'https://packagemanager.rstudio.com/cran/__linux__/focal/latest'} | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_KEEP_PKG_SOURCE: true | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
R_REPOS: ${{ matrix.config.repos }} | |
steps: | |
##################### BEGIN boilerplate steps ##################### | |
- name: Get branch names | |
id: branch-name | |
uses: tj-actions/branch-names@v8 | |
- name: Setup pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Checkout repo (PR) 🛎 | |
uses: actions/checkout@v4 | |
if: github.event_name == 'pull_request' | |
with: | |
ref: ${{ steps.branch-name.outputs.head_ref_branch }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
if: github.event_name != 'pull_request' | |
with: | |
ref: ${{ steps.branch-name.outputs.head_ref_branch }} | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r }} | |
http-user-agent: ${{ matrix.config.http-user-agent }} | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::rcmdcheck | |
needs: check | |
#cache-version: 2 | |
- name: Check | |
env: | |
_R_CHECK_CRAN_INCOMING_REMOTE_: false | |
_R_CHECK_FORCE_SUGGESTS_: false | |
run: | | |
if (!requireNamespace("rcmdcheck", quietly = TRUE)) install.packages("rcmdcheck",dependencies=TRUE) | |
options(crayon.enabled = TRUE) | |
check_error_on <- "${{ inputs.error-on }}" | |
if (check_error_on == "") { | |
check_error_on <- "note" | |
} | |
rcmdcheck::rcmdcheck( | |
# args = c("--no-manual", "--as-cran"), | |
args = c("--no-manual"), | |
error_on = check_error_on, | |
check_dir = "check" | |
) | |
shell: Rscript {0} | |
- name: Upload check results | |
if: failure() | |
uses: actions/upload-artifact@main | |
with: | |
name: ${{ runner.os }}-r${{ matrix.config.r }}-results | |
path: check |