Update spatiotemp_check.R #139
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-check: | |
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: 'oldrel'} | |
# - { os: macOS-latest, r: 'release'} | |
#- { os: macOS-latest, r: 'devel'} | |
#- { os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
CRAN: ${{ matrix.config.rspm }} | |
RGL_USE_NULL: true | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r }} | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Query dependencies | |
if: runner.os == 'Windows' | |
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: Query dependencies | |
if: runner.os == 'macOS' | |
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@v2 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} | |
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- | |
- name: Install pak | |
if: runner.os == 'macOS' | |
run: | | |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") | |
shell: Rscript {0} | |
- name: Install pak | |
if: runner.os == 'Windows' | |
run: | | |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") | |
shell: Rscript {0} | |
- name: Install system dependencies (macOS) | |
if: runner.os == 'macOS' | |
run: | | |
brew install pkg-config | |
brew install gdal | |
brew install imagemagick@6 | |
- name: Install spatial dependencies | |
if: runner.os == 'Linux' | |
run: sudo apt-get install libgdal-dev libproj-dev libgeos-dev libudunits2-dev netcdf-bin libmagick++-dev | |
- name: Install dependencies | |
if: runner.os == 'macOS' | |
run: | | |
install.packages("Rcpp") | |
install.packages('terra', repos='https://rspatial.r-universe.dev') | |
remotes::install_deps(dependencies = TRUE) | |
remotes::install_cran(c("rcmdcheck", "curl")) | |
shell: Rscript {0} | |
- name: Install dependencies | |
if: runner.os == 'Windows' | |
run: | | |
install.packages("Rcpp") | |
install.packages('terra', repos='https://rspatial.r-universe.dev') | |
remotes::install_deps(dependencies = TRUE) | |
remotes::install_cran(c("rcmdcheck", "curl")) | |
shell: Rscript {0} | |
- name: Install dependencies | |
if: runner.os == 'Linux' | |
run: | | |
install.packages(c("remotes", "rcmdcheck")) | |
remotes::install_deps(dependencies = TRUE) | |
shell: Rscript {0} | |
- name: Session info | |
run: | | |
options(width = 100) | |
pkgs <- installed.packages()[, "Package"] | |
sessioninfo::session_info(pkgs, include_base = TRUE) | |
shell: Rscript {0} | |
- name: Check | |
env: | |
_R_CHECK_CRAN_INCOMING_: false | |
run: rcmdcheck::rcmdcheck(args = c("--no-manual","--as-cran"), error_on = "error") | |
shell: Rscript {0} | |
- 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@v2 | |
with: | |
name: ${{ runner.os }}-r${{ matrix.config.r }}-results | |
path: check |