diff --git a/.Rbuildignore b/.Rbuildignore index 81fcff8..504445e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,6 +12,8 @@ # CI & codecov-related ^\.travis\.yml$ ^\.lintr$ +^\.github$ +^benchmarks$ ^logo_maker.R$ ^_pkgdown\.yml$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..7e73ec7 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,89 @@ +# GitHub Actions workflow for R CMD check +# Replaces deprecated Travis CI configuration + +name: R-CMD-check + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + PKG_CFLAGS: "-O3 -Wall -pedantic" + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - name: Install system dependencies (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y \ + libudunits2-dev \ + libproj-dev \ + libgeos-dev \ + libgdal-dev + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: | + any::rcmdcheck + any::covr + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + error-on: 'warning' + + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find ${{ runner.temp }}/package -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 + + - name: Test coverage + if: success() && runner.os == 'Linux' && matrix.config.r == 'release' + run: | + Rscript -e 'covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + )' + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/NEWS.md b/NEWS.md index f7c6c8c..8797245 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,11 @@ # `geohashTools` NEWS +## v0.3.4 (Development) + +### INFRASTRUCTURE + + 1. Migrated from deprecated Travis CI to GitHub Actions for continuous integration. New workflow tests across multiple R versions (release, devel, oldrel-1) and operating systems (Ubuntu, macOS, Windows), providing more comprehensive coverage. Badge updated in README. + ## v0.3.3 Drop references to deprecated rgdal. diff --git a/README.md b/README.md index 6858431..1c86362 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ output: github_document ![logo](logo.png "geohashTools") +[![R-CMD-check](https://github.com/MichaelChirico/geohashTools/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/MichaelChirico/geohashTools/actions/workflows/R-CMD-check.yaml) [![codecov](https://codecov.io/gh/MichaelChirico/geohashTools/branch/master/graph/badge.svg)](https://app.codecov.io/gh/MichaelChirico/geohashTools?branch=master) -[![Build Status](https://app.travis-ci.com/MichaelChirico/geohashTools.svg?branch=master)](https://app.travis-ci.com/MichaelChirico/geohashTools) [![CRAN status](https://www.r-pkg.org/badges/version/geohashTools)](https://cran.r-project.org/package=geohashTools) This package provides tools for working with [Gustavo](https://github.com/niemeyer) [Niemeyer](https://twitter.com/gniemeyer)'s [geohash](https://en.wikipedia.org/wiki/Geohash) system of nestable, compact global coordinates based on [Z-order curves](https://en.wikipedia.org/wiki/Z-order_curve). The system consists of carving the earth into equally-sized rectangles (when projected into latitude/longitude space) and nesting this process recursively. diff --git a/tests/testthat/test-gis-tools.R b/tests/testthat/test-gis-tools.R index 1e06aa2..00e9d46 100644 --- a/tests/testthat/test-gis-tools.R +++ b/tests/testthat/test-gis-tools.R @@ -172,7 +172,7 @@ test_that('gh_covering works', { sp::proj4string(banjarmasin) = NA_character_ banjarmasin_cover = gh_covering(banjarmasin, minimal = TRUE) sp::proj4string(banjarmasin_cover) = wgs - expect_equivalent(banjarmasin_cover, banjarmasin_tight) + expect_equal(banjarmasin_cover, banjarmasin_tight, ignore_attr = TRUE) # works for SpatialPointsDataFrame when minimal=TRUE, #30 banjarmasinDF = sp::SpatialPointsDataFrame(