From 031e4581d6a99dc3f85f1b89eb7f3020fe10213a Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Wed, 31 Jan 2024 17:12:52 +0100 Subject: [PATCH 01/11] Add codecov action --- .github/workflows/R-test-coverage.yml | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/R-test-coverage.yml diff --git a/.github/workflows/R-test-coverage.yml b/.github/workflows/R-test-coverage.yml new file mode 100644 index 0000000..1051c18 --- /dev/null +++ b/.github/workflows/R-test-coverage.yml @@ -0,0 +1,47 @@ +# 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: + workflow_call: + +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 From c35c3673ddd1405c287942d6d4f4f1d8e2537232 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Wed, 31 Jan 2024 17:14:51 +0100 Subject: [PATCH 02/11] Run codecov on push, not workflow_call --- .github/workflows/R-test-coverage.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/R-test-coverage.yml b/.github/workflows/R-test-coverage.yml index 1051c18..27d4528 100644 --- a/.github/workflows/R-test-coverage.yml +++ b/.github/workflows/R-test-coverage.yml @@ -1,7 +1,10 @@ # 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: - workflow_call: + push: + branches: [main, master] + pull_request: + branches: [main, master] name: test-coverage From ecfe4910d4ac536aacc216165095bd9d034a70b4 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Wed, 31 Jan 2024 17:19:29 +0100 Subject: [PATCH 03/11] Add badges --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index df63919..e1b489b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # 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) +[![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 defines by this repo accepts a directory of portfolios (mounted to `/mnt/input/`) and exports sanitized versions of those portfolios ready for further processing via PACTA (in `/mnt/outputs`) From 07a8e3182fcc50bc7a6b079190a4b5e8e758d863 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Wed, 31 Jan 2024 17:22:37 +0100 Subject: [PATCH 04/11] Increment version number to 0.1.0 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index f630308..12d3133 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 Authors@R: c( person( From 91b8111a115b247e34663bfd4fc8c78470e2b472 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Wed, 31 Jan 2024 17:25:43 +0100 Subject: [PATCH 05/11] Use RMI-PACTA/actions R actions --- .github/workflows/R.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/R.yml 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 From bb1d5320f4da6088f8c3da3d972e0484ca04ec56 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Wed, 31 Jan 2024 17:28:35 +0100 Subject: [PATCH 06/11] Change reference to remote actions --- .github/workflows/R.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R.yml b/.github/workflows/R.yml index 5ace314..7ffef26 100644 --- a/.github/workflows/R.yml +++ b/.github/workflows/R.yml @@ -18,4 +18,4 @@ name: R jobs: R-package: name: R Package Checks - uses: RMI-PACTA/actions/.github/workflows/R.yml@main + uses: RMI-PACTA/Actions/.github/workflows/R.yml@main From 5c59f2bfec3a727360d40ed2a4dc5116d2f85528 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Wed, 31 Jan 2024 17:35:02 +0100 Subject: [PATCH 07/11] change remote action url --- .github/workflows/R.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R.yml b/.github/workflows/R.yml index 7ffef26..5ace314 100644 --- a/.github/workflows/R.yml +++ b/.github/workflows/R.yml @@ -18,4 +18,4 @@ name: R jobs: R-package: name: R Package Checks - uses: RMI-PACTA/Actions/.github/workflows/R.yml@main + uses: RMI-PACTA/actions/.github/workflows/R.yml@main From c99cfb05b98d94162e1320ba4a4420d15e9a005d Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Wed, 31 Jan 2024 17:38:42 +0100 Subject: [PATCH 08/11] Project status active, experimental --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e1b489b..39a744e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # 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 defines by this repo accepts a directory of portfolios (mounted to `/mnt/input/`) and exports sanitized versions of those portfolios ready for further processing via PACTA (in `/mnt/outputs`) From 7a10fdf68cc3ce820f49c5436b604b834a927ea7 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Wed, 31 Jan 2024 17:39:43 +0100 Subject: [PATCH 09/11] Remove standalone `lintr` --- .github/workflows/lint-package.yaml | 32 ----------------------------- 1 file changed, 32 deletions(-) delete mode 100644 .github/workflows/lint-package.yaml 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 From 76e3fa0e9ca8d90efa906a6d8a89eeefc4f60581 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Wed, 31 Jan 2024 20:43:25 +0100 Subject: [PATCH 10/11] refactor(app): make output of main function invisible Otherwise Rscript outputs the object to stdout, which can mess with the logs --- R/process_directory.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/process_directory.R b/R/process_directory.R index 365451e..47a2fe4 100644 --- a/R/process_directory.R +++ b/R/process_directory.R @@ -15,5 +15,5 @@ process_directory <- function( all_summaries <- c(all_summaries, list(portfolio_summary)) } logger::log_info("Done processing directory.") - return(all_summaries) + return(invisible(all_summaries)) } From 4df560b5e914e58379228e219058a2d42264fa52 Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Mon, 5 Feb 2024 17:02:41 +0100 Subject: [PATCH 11/11] chore(package): bump to dev version bump to dev version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index c0ee98b..19bed38 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: workflow.portfolio.parsing Title: Reads, cleans, and reexports portfolios for PACTA -Version: 0.1.0 +Version: 0.1.0.9000 Authors@R: c( person(