Skip to content

Commit

Permalink
Merge pull request #218 from r-spatialecology/master
Browse files Browse the repository at this point in the history
Update v1.5.1
  • Loading branch information
mhesselbarth authored Dec 4, 2020
2 parents bd7dc7d + 80e2748 commit ac0a002
Show file tree
Hide file tree
Showing 23 changed files with 660 additions and 410 deletions.
3 changes: 1 addition & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
^CRAN-RELEASE$
^.*\.Rproj$
^\.Rproj\.user$
^\.travis\.yml$
^README.*$
^NOTES.*$
^notes.*$
Expand All @@ -15,10 +14,10 @@
^CONTRIBUTING.*$
^LICENSE.*$
^data-raw$
^appveyor\.yml$
vignettes/articles
^codemeta\.json$
^tic\.R$
^vignettes/articles$
^\.httr-oauth$
^pkgdown
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
55 changes: 55 additions & 0 deletions .github/workflows/Deploy-pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on:
push:
branches:
- CRAN
- master

name: Deploy-pkgdown

jobs:
pkgdown:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

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

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

- 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
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 dependencies
run: |
install.packages("remotes")
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("pkgdown", type = "binary")
remotes::install_cran("patchwork")
remotes::install_cran("tidyverse")
remotes::install_version("SDMTools", version = "1.1-221.2")
remotes::install_cran("NLMR")
remotes::install_cran("landscapetools")
remotes::install_cran("bench")
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)'
83 changes: 83 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# 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
on:
push:
branches:
- CRAN
- master
pull_request:
branches:
- CRAN
- 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: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}

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

- 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
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'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
33 changes: 33 additions & 0 deletions .github/workflows/Render-README.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
push:
paths:
- README.Rmd

name: Render-README

jobs:
render:
name: Render README
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v1
- name: Install rmarkdown, remotes, and the local package
run: |
install.packages("remotes")
remotes::install_local(".")
remotes::install_cran("rmarkdown")
remotes::install_cran("landscapetools")
shell: Rscript {0}
- name: Render README
run: Rscript -e 'rmarkdown::render("README.Rmd")'
- name: Commit results
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add README.md man/figures/README-*
git commit -m 'Re-build README.Rmd' || echo "No changes to commit"
git push origin || echo "No changes to commit"
48 changes: 48 additions & 0 deletions .github/workflows/Test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches:
- CRAN
- master
pull_request:
branches:
- CRAN
- master

name: Test-coverage

jobs:
test-coverage:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

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

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

- 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
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 dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
54 changes: 0 additions & 54 deletions .travis.yml

This file was deleted.

16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ We appreciate any contribution and collaboration.

### Code contributions

* Fork this repo to your Github account
* Clone your version on your account down to your machine from your account, e.g,. `git clone https://github.com/r-spatialecology/landscapemetrics.git`
* Make sure to track progress upstream (i.e., on our version of `landscapemetrics` at `r-spatialecology/landscapemetrics`) by doing `git remote add upstream https://github.com/r-spatialecology/landscapemetrics.git`.
Before making changes make sure to pull changes in from upstream by doing either `git fetch upstream` then merge later or `git pull upstream` to fetch and merge in one step
* Make your changes (bonus points for making changes on a new branch)
* If you alter package functionality at all (e.g., the code itself, not just documentation) please do write some tests to cover the new functionality
* Push up to your account
* Submit a pull request to home base at `r-spatialecology/landscapemetrics`
1. Fork this repo to your GitHub account
2. Clone your version to your machine, e.g., `git clone https://github.com/r-spatialecology/landscapemetrics.git`
3. Make sure to track progress upstream (i.e., our version of `landscapemetrics` at `r-spatialecology/landscapemetrics`) by doing `git remote add upstream https://github.com/r-spatialecology/landscapemetrics.git`
Before making any changes, make sure to pull changes in from upstream by either doing `git fetch upstream` then merge later, or `git pull upstream` to fetch and merge in one step
4. Make your changes (bonus points for making changes on a new branch)
5. If you alter package functionality at all (e.g., the code itself, not just documentation) please do write some tests to cover the new functionality.
6. Push changes to your account
7. Submit a pull request to the master branch at `r-spatialecology/landscapemetrics`

### Questions? Get in touch: [[email protected]](mailto:[email protected]) or [[email protected]](mailto:[email protected])

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: landscapemetrics
Title: Landscape Metrics for Categorical Map Patterns
Version: 1.5.0
Version: 1.5.1
Authors@R: c(person("Maximillian H.K.", "Hesselbarth",
role = c("aut", "cre"),
email = "[email protected]",
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# landscapemetrics 1.5.1
* Improvements
* Use GitHub actions
* Bugfixes
* Bug in `lsm_c_lsi`, `lsm_c_nlsi`, `lsm_l_lsi` not using cell surfaces

# landscapemetrics 1.5.0
* Improvements
* Improved internal understandment of input classes
Expand Down
Loading

0 comments on commit ac0a002

Please sign in to comment.