diff --git a/.Rbuildignore b/.Rbuildignore index b94846d..b339330 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -13,3 +13,4 @@ # flint files ^flint$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..d46a617 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,52 @@ +# 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.yaml + +permissions: read-all + +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'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + 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 + + - 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 + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..4bbce75 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -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] + release: + types: [published] + workflow_dispatch: + +name: pkgdown.yaml + +permissions: read-all + +jobs: + pkgdown: + 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@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..9882260 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,61 @@ +# 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.yaml + +permissions: read-all + +jobs: + test-coverage: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + + - 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, any::xml2 + needs: coverage + + - name: Test coverage + run: | + cov <- covr::package_coverage( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) + covr::to_cobertura(cov) + shell: Rscript {0} + + - uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} + file: ./cobertura.xml + plugin: noop + disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} + + - 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@v4 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/.woodpecker/R-CMD-check.yaml b/.woodpecker/R-CMD-check.yaml deleted file mode 100644 index e165206..0000000 --- a/.woodpecker/R-CMD-check.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# Runs R CMD check for an R package while installing dependencies with pak. -# https://github.com/r-lib/pak is used to install package dependencies. -# The first command installs pak following the install instruction of package itself. -# -# When setting Ncpus (default=1) to a higher value, pak will download and install package in parallel. -# pak automatically uses binary packages from the public Posit Package Manager. -# -# This example uses the rocker/r-base image to run the R CMD check. Any other image with R installed can be used. -# Alternatively, the rcmdcheck package can be installed and use in replacement to `R CMD check``. - -steps: - 'Check package': - when: - event: [push, pull_request] -image: rocker/r-base -secrets: [github_pat] -commands: - - R -q -s -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' -- R -q -e 'options(Ncpus = 4)' -- R -q -e 'pak::pak()' -- R CMD check --as-cran . diff --git a/DESCRIPTION b/DESCRIPTION index 172ec8b..1ca62b3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,9 +11,8 @@ Description: Download and import data from the Australian Bureau of Agricultural and Resource Economics and Sciences (ABARES) . License: MIT + file LICENSE -URL: https://codeberg.org/adamhsparks/read.abares, - https://adamhsparks.codeberg.page/read.abares -BugReports: https://codeberg.org/adamhsparks/read.abares/issues +URL: https://github.org/adamhsparks/read.abares, https://adamhsparks.github.io/read.abares, https://adamhsparks.github.io/read.abares/ +BugReports: https://github.com/adamhsparks/read.abares/issues Imports: cli, curl, diff --git a/README.Rmd b/README.Rmd index 4d05e70..bc58cb8 100644 --- a/README.Rmd +++ b/README.Rmd @@ -18,6 +18,8 @@ knitr::opts_chunk$set( [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) +[![R-CMD-check](https://github.com/adamhsparks/read.abares/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/adamhsparks/read.abares/actions/workflows/R-CMD-check.yaml) +[![Codecov test coverage](https://codecov.io/gh/adamhsparks/read.abares/graph/badge.svg)](https://app.codecov.io/gh/adamhsparks/read.abares) An R package for automated downloading and ingestion of data from the Australian Bureau of Agricultural and Resource Economics and Sciences. diff --git a/README.md b/README.md index c88f241..6df5a4a 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ stable](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecy [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) +[![R-CMD-check](https://github.com/adamhsparks/read.abares/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/adamhsparks/read.abares/actions/workflows/R-CMD-check.yaml) +[![Codecov test +coverage](https://codecov.io/gh/adamhsparks/read.abares/graph/badge.svg)](https://app.codecov.io/gh/adamhsparks/read.abares) An R package for automated downloading and ingestion of data from the diff --git a/_pkgdown.yml b/_pkgdown.yml index 636ba92..1322589 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,36 +1,28 @@ -url: https://adamhsparks.codeberg.page/read.abares +url: https://adamhsparks.github.io/read.abares/ template: bootstrap: 5 params: bootswatch: journal - reference: - - title: AAGIS Regions - desc: > + desc: | Fetch and read the AAGIS regions - contents: - - get_aagis_regions - + contents: get_aagis_regions - title: AGFD - - subtitle: Fetch - desc: > - Fetch the Australian Gridded Farm Data - contents: - - get_agfd - + desc: | + Fetch the Australian Gridded Farm Data + contents: get_agfd - subtitle: Read - desc: > + desc: | Read the Australian Gridded Farm Data contents: - read_agfd_dt - read_agfd_stars - read_agfd_terra - read_agfd_tidync - - title: Estimates - desc: > + desc: | Fetch and read the ABARES Estimates data contents: - get_estimates_by_performance_category @@ -38,32 +30,28 @@ reference: - get_historical_national_estimates - get_historical_regional_estimates - get_historical_state_estimates - - title: Historical agricultural forecast database - desc: > + desc: | Fetch and read the historical agricultural forecast database - contents: - - get_historical_forecast_database - + contents: get_historical_forecast_database - title: Cache - desc: > + desc: | Work with your local file cache contents: - clear_cache - inspect_cache - - title: Soil Thickness - desc: > + desc: | Soil Thickness for Australian areas of intensive agriculture of Layer 1 (A Horizon - top-soil) (derived from soil mapping) contents: - get_soil_thickness - read_soil_thickness_stars - read_soil_thickness_terra - print_soil_thickness_metadata - - title: Trade - desc: > + desc: | Fetch and read ABARES' Australian agricultural export data contents: - get_abares_trade - get_abares_trade_regions + diff --git a/codemeta.json b/codemeta.json index 715c057..00e1159 100644 --- a/codemeta.json +++ b/codemeta.json @@ -4,9 +4,9 @@ "identifier": "read.abares", "description": "Download and import data from the Australian Bureau of Agricultural and Resource Economics and Sciences (ABARES) .", "name": "read.abares: Provides simple downloading, parsing and importing of Australian\n Bureau of Agricultural and Resource Economics and Sciences (ABARES)\n data sources", - "relatedLink": "https://adamhsparks.codeberg.page/read.abares", - "codeRepository": "https://codeberg.org/adamhsparks/read.abares", - "issueTracker": "https://codeberg.org/adamhsparks/read.abares/issues", + "relatedLink": "https://github.org/adamhsparks/read.abares", + "codeRepository": "https://github.com/adamhsparks/read.abares", + "issueTracker": "https://github.com/adamhsparks/read.abares/issues", "license": "https://spdx.org/licenses/MIT", "version": "0.1.0", "programmingLanguage": { @@ -267,7 +267,7 @@ }, "SystemRequirements": null }, - "fileSize": "327.687KB", + "fileSize": "328.445KB", "citation": [ { "@type": "SoftwareSourceCode", @@ -283,5 +283,8 @@ "description": "R package version 0.1.0" } ], - "developmentStatus": ["https://lifecycle.r-lib.org/articles/stages.html#stable", "https://www.repostatus.org/#active"] + "releaseNotes": "https://github.com/adamhsparks/read.abares/blob/master/NEWS.md", + "readme": "https://github.com/adamhsparks/read.abares/blob/main/README.md", + "developmentStatus": ["https://lifecycle.r-lib.org/articles/stages.html#stable", "https://www.repostatus.org/#active"], + "keywords": ["agriculture", "australia", "data-retrieval", "open-data", "open-datasets", "r"] } diff --git a/man/read.abares-package.Rd b/man/read.abares-package.Rd index ef50401..69f9816 100644 --- a/man/read.abares-package.Rd +++ b/man/read.abares-package.Rd @@ -13,9 +13,10 @@ Download and import data from the Australian Bureau of Agricultural and Resource \seealso{ Useful links: \itemize{ - \item \url{https://codeberg.org/adamhsparks/read.abares} - \item \url{https://adamhsparks.codeberg.page/read.abares} - \item Report bugs at \url{https://codeberg.org/adamhsparks/read.abares/issues} + \item \url{https://github.org/adamhsparks/read.abares} + \item \url{https://adamhsparks.github.io/read.abares} + \item \url{https://adamhsparks.github.io/read.abares/} + \item Report bugs at \url{https://github.com/adamhsparks/read.abares/issues} } }