diff --git a/.github/workflows/R-test-coverage.yml b/.github/workflows/R-test-coverage.yml new file mode 100644 index 0000000..27d4528 --- /dev/null +++ b/.github/workflows/R-test-coverage.yml @@ -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(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "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 diff --git a/.github/workflows/R.yml b/.github/workflows/R.yml new file mode 100644 index 0000000..5ace314 --- /dev/null +++ b/.github/workflows/R.yml @@ -0,0 +1,21 @@ +--- +# This example file will enable R language checks on push or PR to the main +# branch. +# +# Note the @main in `uses:` on the last line. This will call the latest version +# of the workflow from the `main` brnach in the RMI-PACTA/actions repo. You can +# also specify a tag from that repo, or a commit SHA to pin action versions. +on: + push: + branches: + - main + pull_request: + branches: + - main + +name: R + +jobs: + R-package: + name: R Package Checks + uses: RMI-PACTA/actions/.github/workflows/R.yml@main diff --git a/.github/workflows/lint-package.yaml b/.github/workflows/lint-package.yaml deleted file mode 100644 index f60d047..0000000 --- a/.github/workflows/lint-package.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# 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: lint - -jobs: - lint: - 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::lintr, local::. - needs: lint - - - name: Lint - run: lintr::lint_package() - shell: Rscript {0} - env: - LINTR_ERROR_ON_LINT: true diff --git a/DESCRIPTION b/DESCRIPTION index 6eb99f6..19bed38 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: workflow.portfolio.parsing Title: Reads, cleans, and reexports portfolios for PACTA -Version: 0.0.0.9000 +Version: 0.1.0.9000 Authors@R: c( person( diff --git a/R/process_directory.R b/R/process_directory.R index d7508c9..4e7bd6c 100644 --- a/R/process_directory.R +++ b/R/process_directory.R @@ -35,5 +35,5 @@ process_directory <- function( writeLines(summaries_json, metadata_path) logger::log_debug("Metadata JSON file written.") - return(all_summaries) + return(invisible(all_summaries)) } diff --git a/README.md b/README.md index 8571d67..539e572 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # workflow.portfolio.parsing - -[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip) + +[![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) +[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) +[![codecov](https://codecov.io/gh/RMI-PACTA/workflow.portfolio.parsing/graph/badge.svg?token=ewpls5qPVK)](https://codecov.io/gh/RMI-PACTA/workflow.portfolio.parsing) + The docker image defined by this repo accepts a directory of portfolios (mounted to `/mnt/input/`, see [Inputs](#inputs)) and exports sanitized versions of those portfolios ready for further processing via PACTA (in `/mnt/output`, see [Outputs](#outputs),)