Skip to content

Commit

Permalink
Merge pull request #775 from olivroy/pr-branch
Browse files Browse the repository at this point in the history
Improve continuous integration + tweak to improve R CMD CHECK log
  • Loading branch information
mtennekes authored Sep 15, 2023
2 parents 3e6ceef + 31323c3 commit e013d38
Show file tree
Hide file tree
Showing 48 changed files with 497 additions and 291 deletions.
4 changes: 1 addition & 3 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ local
LICENSE
README
.Rprofile
.travis.yml
appveyor.yml
tic.R
build/
gdal-2.1.0
gdal-2.1.0.tar.gz
ubuntu_16_installation.sh
Expand Down
Binary file removed ._.Rhistory
Binary file not shown.
47 changes: 47 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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]
pull_request:
branches: [main, master]

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: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3

- 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

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
68 changes: 31 additions & 37 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,54 +1,48 @@
# 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: master
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: macOS-latest
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@master
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-pandoc@master

- 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-r@v2
with:
use-public-rspm: true

- name: Cache R packages
uses: actions/cache@v1
- uses: r-lib/actions/setup-r-dependencies@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: Brew
run: |
brew install pkg-config
brew install udunits
brew install gdal
brew install sqlite3
brew install v8
extra-packages: any::pkgdown, local::.
needs: website

- name: Install dependencies
run: |
install.packages("remotes")
remotes::install_dev("tmaptools")
remotes::install_deps(dependencies = TRUE)
remotes::install_dev("pkgdown")
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Deploy package
run: pkgdown::deploy_to_branch(new_process = FALSE)
shell: Rscript {0}
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
50 changes: 50 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
58 changes: 0 additions & 58 deletions .travis.yml

This file was deleted.

7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Imports:
stars (>= 0.4-2),
units (>= 0.6-1),
grid,
cols4all,
cols4all (>= 0.6-1),
classInt (>= 0.4-3),
htmltools,
htmlwidgets,
Expand Down Expand Up @@ -59,7 +59,10 @@ Suggests:
covr,
av,
gifski
URL: https://github.com/r-tmap/tmap
URL: https://github.com/r-tmap/tmap, https://r-tmap.github.io/tmap/
Remotes: r-tmap/tmaptools, mtennekes/cols4all
BugReports: https://github.com/r-tmap/tmap/issues
VignetteBuilder: knitr
RoxygenNote: 7.2.3
Config/Needs/check: Nowosad/spDataLarge, lwgeom
Config/Needs/coverage: Nowosad/spDataLarge, lwgeom
5 changes: 5 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,15 @@ export(tm_fill)
export(tm_format)
export(tm_graticules)
export(tm_grid)
export(tm_iso)
export(tm_layout)
export(tm_legend)
export(tm_legend_combine)
export(tm_legend_hide)
export(tm_lines)
export(tm_logo)
export(tm_markers)
export(tm_minimap)
export(tm_mouse_coordinates)
export(tm_mv)
export(tm_mv_dim)
Expand Down Expand Up @@ -156,6 +160,7 @@ export(tm_scalebar)
export(tm_sf)
export(tm_shape)
export(tm_shape_vars)
export(tm_squares)
export(tm_style)
export(tm_symbols)
export(tm_text)
Expand Down
Loading

0 comments on commit e013d38

Please sign in to comment.