Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dblodgett-usgs committed Nov 16, 2024
1 parent c62cd9a commit 659f75e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 53 deletions.
64 changes: 21 additions & 43 deletions .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,59 +10,37 @@ name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ubuntu-20.04
runs-on: ${{ matrix.config.os }}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
_R_CHECK_TESTS_NLINES_: 0
NOT_CRAN: true
strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@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}
- uses: r-lib/actions/setup-pandoc@v2

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r@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 system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("covr")
shell: Rscript {0}

- name: Check
run: rcmdcheck::rcmdcheck(args = c("--ignore-vignettes", "--no-manual"), build_args = c("--no-build-vignettes"), error_on = "error", check_dir = "check")
shell: Rscript {0}
r-version: ${{ matrix.config.r }}
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, any::covr
needs: check, coverage

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v3
- uses: r-lib/actions/check-r-package@v2
with:
name: results
path: check
upload-snapshots: true

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
shell: Rscript {0}
10 changes: 5 additions & 5 deletions R/calculate_area_intersection_weights.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
#'
#' @examples
#'
#' library(dplyr)
#' library(sf)
#' library(ncdfgeom)
#'
#' g <- list(rbind(c(-1,-1), c(1,-1), c(1,1), c(-1,1), c(-1,-1)))
#'
#' a1 = sf::st_polygon(g) * 0.8
Expand Down Expand Up @@ -97,15 +101,11 @@
#'
#' calculate_area_intersection_weights(b, a, normalize = TRUE)
#'
#' NOTE: normalize = TRUE so weights sum to 1 per target polygon. Non-overlap
#' # NOTE: normalize = TRUE so weights sum to 1 per target polygon. Non-overlap
#' # is ignored as if it does not exist.
#'
#' # a more typical arrangement of polygons
#'
#' library(dplyr)
#' library(sf)
#' library(ncdfgeom)
#'
#' g <- list(rbind(c(-1,-1), c(1,-1), c(1,1),
#' c(-1,1), c(-1,-1)))
#'
Expand Down
10 changes: 5 additions & 5 deletions man/calculate_area_intersection_weights.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 659f75e

Please sign in to comment.