-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
77 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# 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: | ||
push: | ||
branches: [main, master] | ||
branches: | ||
- main | ||
pull_request: | ||
branches: [main, master] | ||
branches: | ||
- main | ||
|
||
name: R-CMD-check | ||
|
||
|
@@ -18,31 +18,94 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
config: | ||
- {os: macos-latest, r: 'devel'} | ||
- {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: windows-latest, r: '3.6'} # Use 3.6 to trigger usage of RTools35 | ||
- {os: windows-latest, r: '4.1'} # use 4.1 to check with rtools40's older compiler | ||
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} | ||
- {os: ubuntu-latest, r: 'release'} | ||
- {os: ubuntu-latest, r: 'oldrel'} | ||
- {os: ubuntu-latest, r: 'oldrel-1'} | ||
- {os: ubuntu-latest, r: 'oldrel-2'} | ||
- {os: ubuntu-latest, r: 'oldrel-3'} | ||
- {os: ubuntu-latest, r: 'oldrel-4'} | ||
- {os: ubuntu-latest, r: 'oldrel-5'} | ||
|
||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
R_KEEP_PKG_SOURCE: yes | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
RSPM: ${{ matrix.config.rspm }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
- uses: r-lib/actions/[email protected] | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
http-user-agent: ${{ matrix.config.http-user-agent }} | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
# For file snapshot that uses png | ||
- name: Install xquartz | ||
if: runner.os == 'macOS' | ||
run: brew install --cask xquartz | ||
|
||
# - uses: r-lib/actions/[email protected] | ||
# with: | ||
# extra-packages: any::rcmdcheck | ||
# needs: check | ||
|
||
- name: Query dependencies | ||
run: | | ||
install.packages('remotes') | ||
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | ||
shell: Rscript {0} | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
- name: Cache R packages | ||
if: runner.os != 'Windows' | ||
uses: actions/cache@v1 | ||
with: | ||
extra-packages: any::rcmdcheck | ||
needs: check | ||
path: ${{ env.R_LIBS_USER }} | ||
key: ${{ runner.os }}-r-${{ matrix.config.r }}-1-${{ hashFiles('.github/depends.Rds') }} | ||
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-1- | ||
|
||
- uses: r-lib/actions/check-r-package@v2 | ||
- name: Install macOS specific dependencies for sf | ||
if: runner.os == 'macOS' | ||
run: brew install udunits gdal proj | ||
|
||
- name: Install Linux specific dependencies for sf | ||
if: runner.os == 'Linux' | ||
run: sudo apt-get install libgdal-dev libproj-dev libgeos-dev libudunits2-dev | ||
|
||
- name: Install language dependencies | ||
run: | | ||
remotes::install_deps(dependencies = TRUE, build = FALSE) | ||
remotes::install_cran("rcmdcheck") | ||
shell: Rscript {0} | ||
|
||
- name: Session info | ||
run: | | ||
options(width = 100) | ||
pkgs <- installed.packages()[, 'Package'] | ||
sessioninfo::session_info(pkgs, include_base = TRUE) | ||
shell: Rscript {0} | ||
|
||
- uses: r-lib/actions/[email protected] | ||
with: | ||
upload-snapshots: true | ||
|
||
- name: Show testthat output | ||
if: always() | ||
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true | ||
shell: bash | ||
|
||
- name: Upload check results | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ runner.os }}-r${{ matrix.config.r }}-results | ||
path: check |