dev ver bump #930
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: [push, pull_request] | |
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: windows-latest, r: 'release', rtools: '43'} | |
- { os: macOS-latest, r: 'release', rtools: ''} | |
- { os: ubuntu-20.04, r: 'release', rtools: ''} | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
CRAN: ${{ matrix.config.cran }} | |
VCR_VERBOSE_ERRORS: true | |
GEONAMES_USER: ${{ secrets.GEONAMES_USER }} | |
GBIF_EMAIL: ${{ secrets.GBIF_EMAIL }} | |
GBIF_USER: ${{ secrets.GBIF_USER }} | |
GBIF_PWD: ${{ secrets.GBIF_PWD }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r }} | |
rtools-version: ${{ matrix.config.rtools }} | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Query dependencies | |
run: | | |
install.packages('remotes') | |
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | |
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") | |
shell: Rscript {0} | |
- name: Cache R packages | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2-${{ hashFiles('.github/depends.Rds') }} | |
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2- | |
- name: Install pak | |
run: | | |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/devel/") | |
shell: Rscript {0} | |
- name: install macOS system dependencies | |
if: runner.os == 'macOS' | |
continue-on-error: true | |
run: | | |
brew install pkg-config gdal geos openssl udunits protobuf proj | |
- name: Install system dependencies | |
if: runner.os == 'Linux' | |
env: | |
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc | |
run: | | |
Rscript -e 'writeLines(pak::local_system_requirements("ubuntu", "20.04", execute = TRUE, sudo = TRUE, echo = TRUE))' | |
- name: Install dependencies Linux | |
if: runner.os == 'Linux' | |
run: | | |
pak::local_install_dev_deps() | |
pak::pkg_install(c("sf","rcmdcheck", "maps", "scales", "colorspace", "terra", "magick", "protolite")) | |
shell: Rscript {0} | |
- name: Install dependencies macOS and Windows | |
if: runner.os == 'macOS' || runner.os == 'Windows' | |
run: | | |
pak::local_install_dev_deps() | |
pak::pkg_install(c("sf","rcmdcheck", "maps", "scales", "colorspace", "terra", "magick", "protolite")) | |
shell: Rscript {0} | |
- name: Session info | |
run: | | |
options(width = 100) | |
pkgs <- installed.packages()[, "Package"] | |
utils::sessionInfo(pkgs) | |
shell: Rscript {0} | |
- name: Check | |
env: | |
_R_CHECK_CRAN_INCOMING_: false | |
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") | |
shell: Rscript {0} | |
- name: Show testthat output | |
if: always() | |
run: find check -name 'test-all.Rout*' -exec cat '{}' \; || true | |
shell: bash | |
- name: Upload check results | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ runner.os }}-r${{ matrix.config.r }}-results | |
path: check | |
- name: Test coverage | |
if: matrix.config.os == 'windows-latest' && matrix.config.r == 'release' | |
run: | | |
install.packages(c("remotes")) | |
remotes::install_deps(dependencies = TRUE) | |
remotes::install_cran("covr") | |
covr::codecov() | |
shell: Rscript {0} | |
# | |
# - name: Test coverage | |
# if: matrix.config.os == 'ubuntu-18.04' && matrix.config.r == 'release' | |
# run: | | |
# Rscript -e 'remotes::install_cran("covr")' -e 'covr::codecov()' |