R-CMD-check #128
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
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | |
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main, master] | |
pull_request: | |
branches: [main, master] | |
schedule: | |
- cron: '0 0 * * 0' | |
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: macOS-latest, r: 'release'} | |
- {os: windows-latest, r: 'release'} | |
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} | |
- {os: ubuntu-latest, r: 'release'} | |
- {os: ubuntu-latest, r: 'oldrel-1'} | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_KEEP_PKG_SOURCE: yes | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-tinytex@v2 | |
env: | |
# install full prebuilt version | |
TINYTEX_INSTALLER: TinyTeX | |
- name: Install Ghostscript on Linux | |
if: runner.os == 'Linux' | |
run: sudo DEBIAN_FRONTEND=noninteractive apt-get install --yes ghostscript | |
- name: Install Ghostscript on Windows | |
if: runner.os == 'Windows' | |
run: | | |
# Set up chocolatey profile so that refreshenv is an powershell alias | |
$env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.." | |
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" | |
# Install ghostscript and update env | |
choco install ghostscript --no-progress | |
refreshenv | |
- 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, any::XML | |
needs: check | |
- name: Check | |
run: | | |
options(crayon.enabled = TRUE) | |
Sys.info()['sysname'] | |
# Set R_GSCMD in Windows | |
if (Sys.info()['sysname'] == "Windows") { | |
system.partition = 'c:' | |
dirs = c('Program Files', 'Program Files (x86)') | |
for (dir in dirs) { | |
dir.list = list.dirs(file.path(system.partition, dir), recursive = FALSE) | |
GsinList = grepl(pattern = 'gs', x = dir.list) | |
if (sum(GsinList) > 0) { | |
gsDirectory = which(GsinList == TRUE) | |
GsExeFiles = list.files( | |
dir.list[gsDirectory], | |
recursive = TRUE, | |
pattern = 'gswin', | |
include.dirs = TRUE, | |
full.names = TRUE | |
)[1] | |
message('Gs found! ~> ',GsExeFiles) | |
Sys.setenv(R_GSCMD = GsExeFiles) | |
break | |
} | |
} | |
} | |
rcmdcheck::rcmdcheck(args = c("--as-cran", "--run-donttest"), | |
build_args = c("--compact-vignettes=gs+qpdf"), | |
error_on = "warning", check_dir = "check", | |
env = c(`NOT_CRAN` = "true", | |
`_R_CHECK_FORCE_SUGGESTS_` = "true", | |
`_R_STOP_ON_XTFRM_DATA_FRAME_` = "true", | |
`_R_COMPILE_AND_INSTALL_PACKAGES_` = "always", | |
`_R_CHECK_CRAN_INCOMING_USE_ASPELL_` = "false")) | |
shell: Rscript {0} |