Skip to content

Commit

Permalink
Add R-CMD-check to github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
katieb1 committed Oct 13, 2024
1 parent 557229f commit 7ae3713
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 1 deletion.
91 changes: 91 additions & 0 deletions .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
on: [push, pull_request]

name: R-CMD-check

jobs:
R-CMD-check:

# From r-lib/actions
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'devel'}
# - {os: macOS-latest, r: 'release'}
# - {os: macOS-latest, r: 'devel'}
- {os: ubuntu-latest, r: 'release'} # r-lib/actions not supported # r-lib/actions not supported (setup-r OS)
- {os: ubuntu-latest, r: 'devel'} # r-lib/actions not supported # r-lib/actions not supported (setup-r OS)
# - {os: ubuntu-16.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
# - {os: ubuntu-16.04, r: 'devel', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} # r-lib/actions not supported (setup-r R version)
# - {os: ubuntu-18.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/bionic/latest"}
#- {os: ubuntu-18.04, r: 'devel', cran: "https://demo.rstudiopm.com/all/__linux__/bionic/latest"} # r-lib/actions not supported (setup-r R versin)

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
_R_CHECK_DONTTEST_EXAMPLES_: false
RSPM: ${{ matrix.config.rspm }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-tinytex@v2
if: runner.os != 'Windows'

- name: Install GDAL + qpdf / Linux
if: runner.os == 'Linux'
run: |
sudo apt-get install libgdal-dev
sudo apt-get install qpdf
- name: Install GDAL + qpdf / Mac OS
if: runner.os == 'macOS'
run: |
brew install gdal
brew install qpdf
# From r-lib/actions
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-

- name: Install dependencies
run: |
install.packages(c("remotes", "rcmdcheck"))
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}

- name: Check
env:
NOT_CRAN: true
continue-on-error: true
run: |
install.packages("https://cran.r-project.org/src/contrib/Archive/curl/curl_4.3.2.tar.gz", repos=NULL, type="source")
rcmdcheck::rcmdcheck(build_args = c("--no-manual", "--no-build-vignettes"), args = c("--no-manual", "--ignore-vignettes"), error_on = "error")
shell: Rscript {0}

- name: Check as CRAN
env:
NOT_CRAN: false
run: |
install.packages("https://cran.r-project.org/src/contrib/Archive/curl/curl_4.3.2.tar.gz", repos=NULL, type="source")
rcmdcheck::rcmdcheck(build_args = c("--no-manual", "--no-build-vignettes"), args = c("--no-manual", "--ignore-vignettes", "--as-cran"), error_on = "error")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ rsyncrosim.Rcheck
debugging.R
binaries/
# Don't build R-CMD-check (broken)
**/R-CMD-check.yml
#**/R-CMD-check.yml
# tests_in_progress/

0 comments on commit 7ae3713

Please sign in to comment.