Skip to content

feat: Catching errors #147

feat: Catching errors

feat: Catching errors #147

Workflow file for this run

on: push
name: R-CMD-checks
jobs:
main:
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
runs-on: ${{ matrix.config.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Pandoc for windows-latest
if: matrix.config.os == 'windows-latest'
run: |
Set-ExecutionPolicy AllSigned
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install pandoc
- name: Setup Pandoc for ubuntu-latest
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install -y r-cran-xml
sudo apt-get install -y libharfbuzz-dev libfribidi-dev
- name: Setup Pandoc for macOS-latest
if: matrix.config.os == 'macOS-latest'
run: |
brew install pandoc
- name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
needs: check
pak-version: 'stable'
extra-packages: local::. # Necessary to avoid object usage linter errors.
- name: R CMD check
uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual", "--as-cran")'
error-on: '"note"'
check-dir: '"check"'
- name: Lint
if: always()
shell: Rscript {0}
run: |
lints <- lintr::lint_package()
for (lint in lints) print(lint)
quit(status = length(lints) > 0)
- name: Spell Check
if : always()
shell: Rscript {0}
run: |
spell_check <- spelling::spell_check_package(use_wordlist = TRUE)
cli::cli_alert_warning("There are {nrow(spell_check)} spelling error{?s}.")
if (nrow(spell_check) > 0) {
print(spell_check)
}
quit(status = nrow(spell_check) > 0)
- name: Test coverage
if: matrix.config.os == 'ubuntu-latest' && matrix.config.r == 'release'
run: |
Rscript -e 'covr::codecov()'