Skip to content

Commit

Permalink
fix ci + package manual entry (PR #16)
Browse files Browse the repository at this point in the history
* update ci
* package manual entry
  • Loading branch information
jeffreyhanson authored Jul 8, 2024
1 parent 087ad2b commit df31a5f
Show file tree
Hide file tree
Showing 93 changed files with 217 additions and 153 deletions.
69 changes: 29 additions & 40 deletions .github/workflows/R-CMD-check-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,45 +38,42 @@ jobs:
NOT_CRAN: true

steps:
# configure git to prevent it from automatically converting line-endings
# this is important to avoid WARNINGS during CRAN checks
# that are false-positives, see:
# https://msmith.de/2020/03/12/r-cmd-check-github-actions.html
- name: Configure git
run: git config --global core.autocrlf false

- uses: actions/checkout@v2

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

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true

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

- name: Query dependencies
- name: Install system 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}
sudo apt-get install libnlopt-dev coinor-libsymphony-dev
- 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 system dependencies
run: |
sudo apt-get -y install \
libcurl4-openssl-dev coinor-libsymphony-dev coinor-libcbc-dev coinor-libclp-dev \
libudunits2-dev libgdal-dev libgeos-dev libproj-dev libglpk-dev
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
cache-version: 4
extra-packages: |
any::rcmdcheck
any::remotes
any::XML
any::covr
needs: |
check
- name: Install spatial R packages
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("covr")
remotes::install_cran("urlchecker", force = TRUE)
options(repos = "https://cloud.r-project.org/")
install.packages("sf")
install.packages("terra")
shell: Rscript {0}

- name: Session information
Expand All @@ -91,17 +88,9 @@ jobs:
run: |
echo "_R_CHECK_DEPENDS_ONLY_=true" >> $GITHUB_ENV
- name: Check
run: |
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-build-vignettes"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

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

- name: Show testthat output
if: always()
Expand Down
64 changes: 27 additions & 37 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,46 +36,39 @@ jobs:
NOT_CRAN: true

steps:
# configure git to prevent it from automatically converting line-endings
# this is important to avoid WARNINGS during CRAN checks
# that are false-positives, see:
# https://msmith.de/2020/03/12/r-cmd-check-github-actions.html
- name: Configure git
run: git config --global core.autocrlf false

- uses: actions/checkout@v2

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

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true

- 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
- 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 system dependencies
run: |
sudo apt-get -y install \
libcurl4-openssl-dev coinor-libsymphony-dev coinor-libcbc-dev coinor-libclp-dev \
libudunits2-dev libgdal-dev libgeos-dev libproj-dev libglpk-dev
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
cache-version: 4
extra-packages: |
any::rcmdcheck
any::remotes
any::XML
any::covr
any::urlchecker
needs: |
check
- name: Install dependencies
- name: Install spatial R packages
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("covr")
remotes::install_bioc("lpsymphony")
remotes::install_cran("urlchecker")
options(repos = "https://cloud.r-project.org/")
install.packages("sf")
install.packages("terra")
shell: Rscript {0}

- name: Session information
Expand All @@ -85,19 +78,16 @@ jobs:
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Set environmental variables for package checks
if: matrix.config.pkgs == 'depends only'
run: |
echo "_R_CHECK_DEPENDS_ONLY_=true" >> $GITHUB_ENV
- name: Check URLs
if: runner.os == 'Linux' && matrix.config.r == 'release'
run: |
result <- urlchecker::url_check()
result <- result[result$Message != "OK", , drop = FALSE]
result <- result[result$URL != "https://www.bcassessment.ca/", , drop = FALSE]
result <- result[!startsWith(result$URL, "https://doi.org/"), , drop = FALSE]
if (nrow(result) > 0) {
print(result)
print(str(result))
stop("Invalid URLs detected")
}
shell: Rscript {0}
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: prioritizrdata
Type: Package
Version: 0.3.2.1
Version: 0.3.2.2
Title: Conservation Planning Datasets
Description: Conservation planning datasets for learning how to use the
'prioritizr' package <https://CRAN.R-project.org/package=prioritizr>.
Expand All @@ -21,7 +21,7 @@ Authors@R:
person(c('Peter'), 'Arcese',
email='[email protected]', role = c('aut'),
comment = c(ORCID = '0000-0002-8097-482X')),
person(c('Joseph'), 'Bennett',
person(c('Joseph', 'R'), 'Bennett',
email='[email protected]', role = c('aut'),
comment = c(ORCID = '0000-0002-3901-9513')),
person(c('Hugh', 'P'), 'Possingham',
Expand All @@ -44,7 +44,7 @@ Language: en-US
URL: https://prioritizr.github.io/prioritizrdata/,
https://github.com/prioritizr/prioritizrdata
BugReports: https://github.com/prioritizr/prioritizrdata/issues
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Collate:
'package.R'
'salt_data.R'
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# prioritizrdata 0.3.2.2

- Update package manual entry.

# prioritizrdata 0.3.2.1

- Fix aliasing for package manual entry (#14).
Expand Down
1 change: 1 addition & 0 deletions R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#' @name prioritizrdata
#' @docType package
#' @aliases prioritizrdata-package
"_PACKAGE"
NULL

# avoid false positive NOTES
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ publications. To cite the latest official version, please use:
Alternatively, to cite the latest development version, please use:

> Hanson JO, Schuster R, Morrell N, Strimas-Mackey M, Watts ME, Arcese
> P, Bennett J, Possingham HP (2023). prioritizrdata: Conservation
> Planning Datasets. R package version 0.3.2.1. Available at
> P, Bennett J, Possingham HP (2024). prioritizrdata: Conservation
> Planning Datasets. R package version 0.3.2.2. Available at
> <https://github.com/prioritizr/prioritizrdata>.
8 changes: 4 additions & 4 deletions docs/404.html

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

Loading

0 comments on commit df31a5f

Please sign in to comment.