Skip to content

Commit

Permalink
Merge pull request #34 from olivroy/site
Browse files Browse the repository at this point in the history
Move to NEWS.md + use bootstrap 5 for pkgdown!
  • Loading branch information
sjewo authored Jan 11, 2024
2 parents 41b3ef8 + a9769dc commit 004b966
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 155 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
^_pkgdown\.yml$
^docs$
^pkgdown$
^.github
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
102 changes: 17 additions & 85 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
# NOTE: This workflow is overkill for most R packages
# check-standard.yaml is likely a better choice
# usethis::use_github_action("check-standard") will install it.
#
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
# 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
- testing
branches: [main, master]
pull_request:
branches:
- master
- testing
branches: [main, master]

name: R-CMD-check

Expand All @@ -26,92 +18,32 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
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 }}

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

- 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
if: runner.os != 'Windows'
uses: actions/cache@v2
- 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: Install Curl dependency
if: runner.os == 'Linux'
run: |
sudo apt-get install libcurl4-openssl-dev libudunits2-dev libgdal-dev -y
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("sessioninfo")
# for vignette
remotes::install_cran("curl")
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 = "warning", check_dir = "check")
shell: Rscript {0}

- name: Show testthat output
if: success()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r-${{ matrix.config.r }}-chk
path: check

- name: Build binary package
if: success() && runner.os != 'Linux'
run: |
dir.create("build")
remotes::install_cran("devtools")
devtools::build(path = "build", binary = TRUE)
shell: Rscript {0}
extra-packages: any::rcmdcheck
needs: check

- name: Upload build results
if: success() && runner.os != 'Linux'
uses: actions/upload-artifact@main
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r-${{ matrix.config.r }}-pkg
path: build
upload-snapshots: true
58 changes: 29 additions & 29 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +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:
- main
- 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@v3

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

- 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}
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Restore R package cache
uses: actions/cache@v2
- 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-
extra-packages: any::pkgdown, local::.
needs: website

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
install.packages("pkgdown", type = "binary")
- 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: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
9 changes: 0 additions & 9 deletions NEWS

This file was deleted.

35 changes: 35 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# cartogram 0.3.0

* Remove sp, rgdal and maptools from examples and suggestions.

* `cartogram_cont()` has a new parameter `verbose = FALSE` to hide print of size error on each iteration.

# cartogram 0.2.2

* Fix geometry replacement in cartogram_ncont

# cartogram 0.2.0

* Migrated all functions to sf, fixed problems with multipolygons.
* cartogram functions won't accept features with longitude/latitude coordinates anymore.

# cartogram 0.1.1

* Update sf code. Thanks to @Nowosad for speeding things up!

# cartogram 0.1.0

* Non-Overlapping Circles Cartogram (Dorling)

# cartogram 0.0.3

* sf support added

# cartogram 0.0.2

* Non-contiguous Area Cartogram
* Prepare data with missing or extreme values before cartogram calculation for faster convergence

# cartogram 0.0.1

* Initial Release
16 changes: 3 additions & 13 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ output:
fig_height: 3.5
---

<!-- badges: start -->
[![CRAN status](http://www.r-pkg.org/badges/version/cartogram)](https://cran.r-project.org/package=cartogram)
[![Build status](https://github.com/sjewo/cartogram/workflows/R-CMD-check/badge.svg)](https://github.com/sjewo/cartogram/actions?workflow=R-CMD-check)
[![R-CMD-check](https://github.com/sjewo/cartogram/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/sjewo/cartogram/actions/workflows/R-CMD-check.yaml)
[![CRAN Downloads](http://cranlogs.r-pkg.org/badges/cartogram)](https://cran.r-project.org/package=cartogram)
<!-- badges: end -->

```{r, echo=F}
knitr::opts_chunk$set(
Expand All @@ -34,18 +36,6 @@ To upgrade to the latest development version of `cartogram`, install the package
devtools::install_github("sjewo/cartogram")
```

## NEWS
* [0.3.0] Remove `sp`, `rgdal` and `maptools` from examples and suggestions.
`cartogram_cont` has a new parameter `verbose = FALSE` to hide print of size error on each iteration.
* [0.2.0] Migrated all functions to sf, fixed problems with multipolygons.
cartogram functions won't accept features with longitude/latitude coordinates anymore.
* [0.1.1] Update sf code: Thanks to @Nowosad for speeding things up!
* [0.1.0] Non-Overlapping Circles Cartogram (Dorling)
* [0.0.3] sf support added
* [0.0.2] Non-contiguous Area Cartogram
* [0.0.2] Prepare data with missing or extreme values before cartogram calculation for faster convergence
* [0.0.1] Initial Release

## Examples

### Continuous Area Cartogram
Expand Down
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
cartogram: Create Cartograms with R
================

<!-- badges: start -->

[![CRAN
status](http://www.r-pkg.org/badges/version/cartogram)](https://cran.r-project.org/package=cartogram)
[![Build
status](https://github.com/sjewo/cartogram/workflows/R-CMD-check/badge.svg)](https://github.com/sjewo/cartogram/actions?workflow=R-CMD-check)
[![R-CMD-check](https://github.com/sjewo/cartogram/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/sjewo/cartogram/actions/workflows/R-CMD-check.yaml)
[![CRAN
Downloads](http://cranlogs.r-pkg.org/badges/cartogram)](https://cran.r-project.org/package=cartogram)
<!-- badges: end -->

Construct a continuous area cartogram by a rubber sheet distortion
algorithm (Dougenik et al. 1985), non-contiguous Area Cartograms (Olson
Expand All @@ -27,22 +29,6 @@ package `devtools` and run the following command:
devtools::install_github("sjewo/cartogram")
```

## NEWS

- \[0.3.0\] Remove `sp`, `rgdal` and `maptools` from examples and
suggestions. `cartogram_cont` has a new parameter `verbose = FALSE` to
hide print of size error on each iteration.
- \[0.2.0\] Migrated all functions to sf, fixed problems with
multipolygons. cartogram functions won’t accept features with
longitude/latitude coordinates anymore.
- \[0.1.1\] Update sf code: Thanks to @Nowosad for speeding things up!
- \[0.1.0\] Non-Overlapping Circles Cartogram (Dorling)
- \[0.0.3\] sf support added
- \[0.0.2\] Non-contiguous Area Cartogram
- \[0.0.2\] Prepare data with missing or extreme values before cartogram
calculation for faster convergence
- \[0.0.1\] Initial Release

## Examples

### Continuous Area Cartogram
Expand Down
4 changes: 4 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
url: ~
template:
bootstrap: 5

0 comments on commit 004b966

Please sign in to comment.