From efc579e89d98f9cc6f17c801e96c43028d04d6a7 Mon Sep 17 00:00:00 2001 From: Kyle Barrett Date: Wed, 7 Aug 2024 13:05:48 -0400 Subject: [PATCH 1/7] update pkgr --- pkgr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgr.yml b/pkgr.yml index aa4d129..97783d7 100644 --- a/pkgr.yml +++ b/pkgr.yml @@ -11,7 +11,7 @@ Packages: Repos: - CRAN: https://cran.rstudio.com # used for most things - - MPN: https://mpn.metworx.com/snapshots/stable/2023-08-24 # used for specific Metrum packages (such as pmtables & yspec) + - MPN: https://mpn.metworx.com/snapshots/stable/2024-06-12 Lockfile: Type: renv From bfeb9cfe557e6eb8e7e5d2c5f6d4b499dbf7b67e Mon Sep 17 00:00:00 2001 From: Kyle Barrett Date: Wed, 7 Aug 2024 13:36:04 -0400 Subject: [PATCH 2/7] bump roxygen version in description --- DESCRIPTION | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6c97094..eced058 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -46,6 +46,5 @@ Depends: R (>= 3.5.0) Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 VignetteBuilder: knitr - From 37eb86bbc656cab26cb381dd68ee3ee1130a153c Mon Sep 17 00:00:00 2001 From: Kyle Barrett Date: Wed, 7 Aug 2024 13:37:01 -0400 Subject: [PATCH 3/7] tests helpers: prefer CI env var to drone --- R/helpers-for-tests.R | 2 +- man/skip_vdiffr.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/helpers-for-tests.R b/R/helpers-for-tests.R index 918ca0c..88eea00 100644 --- a/R/helpers-for-tests.R +++ b/R/helpers-for-tests.R @@ -1,4 +1,4 @@ -#' Skip test if not on Metworx or Drone +#' Skip test if not on Metworx or CI #' #' Checks for custom `PMF_SKIP_VDIFFR` environment variable and skips any tests #' that use `vdiffr` if set to `"true"`. This is useful because diff --git a/man/skip_vdiffr.Rd b/man/skip_vdiffr.Rd index 3a7cd52..9eb31d6 100644 --- a/man/skip_vdiffr.Rd +++ b/man/skip_vdiffr.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/helpers-for-tests.R \name{skip_vdiffr} \alias{skip_vdiffr} -\title{Skip test if not on Metworx or Drone} +\title{Skip test if not on Metworx or CI} \usage{ skip_vdiffr() } From b57855db30504200d7110d45bf63cd50b61168d4 Mon Sep 17 00:00:00 2001 From: Kyle Barrett Date: Wed, 7 Aug 2024 13:46:36 -0400 Subject: [PATCH 4/7] ci: switch to GitHub Actions - coverage display wasn't set up before, so leaving that alone in the readme for now --- .Rbuildignore | 2 - .drone.yml | 113 --------------------------------- .github/workflows/coverage.yml | 28 ++++++++ .github/workflows/main.yaml | 67 +++++++++++++++++++ README.Rmd | 2 +- README.md | 20 +++--- 6 files changed, 106 insertions(+), 126 deletions(-) delete mode 100644 .drone.yml create mode 100644 .github/workflows/coverage.yml create mode 100644 .github/workflows/main.yaml diff --git a/.Rbuildignore b/.Rbuildignore index 5ed2887..3f6828c 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,8 +3,6 @@ ^.*\.Rproj$ ^\.Rproj\.user$ ^LICENSE\.md$ -^.drone.yml$ -^.drone.jsonnet$ ^README\.Rmd$ ^_pkgdown\.yml$ ^docs$ diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 78ce508..0000000 --- a/.drone.yml +++ /dev/null @@ -1,113 +0,0 @@ ---- -kind: pipeline -type: docker -name: cran-latest - -platform: - os: linux - arch: amd64 - -steps: -- name: pull - image: omerxx/drone-ecr-auth - commands: - - $(aws ecr get-login --no-include-email --region us-east-1) - - docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:cran-latest - volumes: - - name: docker.sock - path: /var/run/docker.sock - -- name: "Check package: R 4.1" - pull: never - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:cran-latest - commands: - - R -s -e 'devtools::install_deps(upgrade = '"'"'always'"'"', dependencies = TRUE)' - - R -s -e 'devtools::load_all(); sessioninfo::session_info()' - - R -s -e 'devtools::check(env_vars = c("PMF_SKIP_VDIFFR" = "true", "NOT_CRAN" = "true"))' - environment: - USER: drone - volumes: - - name: cache - path: /ephemeral - -volumes: -- name: docker.sock - host: - path: /var/run/docker.sock -- name: cache - temp: {} - -trigger: - event: - exclude: - - promote - ---- -kind: pipeline -type: docker -name: pmforest-release - -platform: - os: linux - arch: amd64 - -steps: -- name: pull - image: omerxx/drone-ecr-auth - commands: - - $(aws ecr get-login --no-include-email --region us-east-1) - - docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:latest - volumes: - - name: docker.sock - path: /var/run/docker.sock - -- name: Build package - pull: never - image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:latest - commands: - - git config --global user.email drone@metrumrg.com - - git config --global user.name Drony - - git fetch --tags - - R -s -e 'devtools::install_deps(upgrade = '"'"'always'"'"', dependencies = TRUE)' - - R -s -e 'pkgpub::create_tagged_repo(.dir = '"'"'/ephemeral'"'"')' - volumes: - - name: cache - path: /ephemeral - -- name: "Publish package: ${DRONE_TAG}" - pull: if-not-exists - image: plugins/s3 - settings: - bucket: mpn.metworx.dev - source: /ephemeral/${DRONE_TAG}/**/* - strip_prefix: /ephemeral/${DRONE_TAG}/ - target: /releases/${DRONE_REPO_NAME}/${DRONE_TAG} - volumes: - - name: cache - path: /ephemeral - -- name: "Publish package: latest_tag" - pull: if-not-exists - image: plugins/s3 - settings: - bucket: mpn.metworx.dev - source: /ephemeral/${DRONE_TAG}/**/* - strip_prefix: /ephemeral/${DRONE_TAG}/ - target: /releases/${DRONE_REPO_NAME}/latest_tag - volumes: - - name: cache - path: /ephemeral - -volumes: -- name: docker.sock - host: - path: /var/run/docker.sock -- name: cache - temp: {} - -trigger: - event: - - tag - -depends_on: -- cran-latest diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..c322c48 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,28 @@ +name: coverage +on: + push: + branches: + - 'main' + - 'scratch/**' + pull_request: + +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: metrumresearchgroup/actions/mpn-latest@v1 + - uses: r-lib/actions/setup-r@v2 + with: + r-version: release + use-public-rspm: true + extra-repositories: 'https://mpn.metworx.com/snapshots/stable/${{ env.MPN_LATEST }}' + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::covr + upgrade: 'TRUE' + - name: Run covr + shell: Rscript {0} + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: covr::codecov() diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..614fe61 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,67 @@ +name: CI +on: + push: + branches: + - 'main' + - 'scratch/**' + tags: + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+.[0-9]+' + pull_request: + +jobs: + check: + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + strategy: + fail-fast: false + matrix: + config: + - os: ubuntu-20.04 + r: 4.0.5 + - os: ubuntu-20.04 + r: 4.2.3 + - os: ubuntu-20.04 + r: 4.3.1 + - os: ubuntu-latest + r: release + env: + R_KEEP_PKG_SOURCE: yes + steps: + - uses: actions/checkout@v4 + - uses: metrumresearchgroup/actions/mpn-latest@v1 + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + use-public-rspm: true + extra-repositories: 'https://mpn.metworx.com/snapshots/stable/${{ env.MPN_LATEST }}' + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: | + any::pkgdown + any::rcmdcheck + upgrade: 'TRUE' + - uses: r-lib/actions/check-r-package@v2 + - name: Check pkgdown + shell: Rscript {0} + run: pkgdown::check_pkgdown() + release: + if: github.ref_type == 'tag' + name: Upload release + needs: check + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v4 + - uses: metrumresearchgroup/actions/mpn-latest@v1 + - uses: r-lib/actions/setup-r@v2 + with: + r-version: release + use-public-rspm: true + extra-repositories: 'https://mpn.metworx.com/snapshots/stable/${{ env.MPN_LATEST }}' + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgpub + - uses: metrumresearchgroup/actions/publish-r-release@v1 diff --git a/README.Rmd b/README.Rmd index 2b1bb3d..e921905 100644 --- a/README.Rmd +++ b/README.Rmd @@ -18,7 +18,7 @@ knitr::opts_chunk$set( # pmforest -[![Build Status](https://github-drone.metrumrg.com/api/badges/metrumresearchgroup/pmforest/status.svg)](https://github-drone.metrumrg.com/metrumresearchgroup/pmforest) +[![Build Status](https://github.com/metrumresearchgroup/pmforest/actions/workflows/main.yaml/badge.svg)](https://github.com/metrumresearchgroup/pmforest/actions/workflows/main.yaml) [![codecov](https://codecov.io/gh/metrumresearchgroup/pmforest/branch/main/graph/badge.svg)](https://codecov.io/gh/metrumresearchgroup/pmforest) diff --git a/README.md b/README.md index 557d01f..a2dea93 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Build -Status](https://github-drone.metrumrg.com/api/badges/metrumresearchgroup/pmforest/status.svg)](https://github-drone.metrumrg.com/metrumresearchgroup/pmforest) +Status](https://github.com/metrumresearchgroup/pmforest/actions/workflows/main.yaml/badge.svg)](https://github.com/metrumresearchgroup/pmforest/actions/workflows/main.yaml) [![codecov](https://codecov.io/gh/metrumresearchgroup/pmforest/branch/main/graph/badge.svg)](https://codecov.io/gh/metrumresearchgroup/pmforest) @@ -35,13 +35,13 @@ highlighted as well. ### Featured Vignettes -- [Getting - Started](https://metrumresearchgroup.github.io/pmforest/articles/getting-started.html) - – Data specifications, summarization, and basic plotting methods. -- [Multiple - Simulations](https://metrumresearchgroup.github.io/pmforest/articles/multiple-simulations.html) - – Plotting additional confidence intervals over the ‘replicate’ or - simulation run. +- [Getting + Started](https://metrumresearchgroup.github.io/pmforest/articles/getting-started.html) + – Data specifications, summarization, and basic plotting methods. +- [Multiple + Simulations](https://metrumresearchgroup.github.io/pmforest/articles/multiple-simulations.html) + – Plotting additional confidence intervals over the ‘replicate’ or + simulation run. ## Development @@ -56,8 +56,8 @@ replicate this environment, 3. open package in an R session and run `renv::init()` - - install `renv` \> 0.8.3-4 into default `.libPaths()` if not - already installed + - install `renv` \> 0.8.3-4 into default `.libPaths()` if not + already installed 4. run `pkgr install` in terminal within package directory From b20ce83cc8b67b491a6ac6dc096253074bd567b4 Mon Sep 17 00:00:00 2001 From: Kyle Barrett Date: Wed, 7 Aug 2024 14:03:09 -0400 Subject: [PATCH 5/7] update test svgs --- .../character-interpretation-of-numeric-group-level.svg | 2 +- tests/testthat/_snaps/base-plot/full-test-big.svg | 2 +- tests/testthat/_snaps/base-plot/full-test-small.svg | 2 +- tests/testthat/_snaps/base-plot/full-test.svg | 2 +- tests/testthat/_snaps/base-plot/multiple-lines-for-ci-label.svg | 2 +- tests/testthat/_snaps/base-plot/no-group-level.svg | 2 +- tests/testthat/_snaps/base-plot/numeric-group-level.svg | 2 +- tests/testthat/_snaps/base-plot/test-metagroup-with-labels.svg | 2 +- tests/testthat/_snaps/base-plot/test-metagroup.svg | 2 +- tests/testthat/_snaps/base-plot/update-labels-via-yaml-file.svg | 2 +- tests/testthat/_snaps/nsim-plot/multiple-simulations.svg | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/testthat/_snaps/base-plot/character-interpretation-of-numeric-group-level.svg b/tests/testthat/_snaps/base-plot/character-interpretation-of-numeric-group-level.svg index 4d9f180..c3bfbfe 100644 --- a/tests/testthat/_snaps/base-plot/character-interpretation-of-numeric-group-level.svg +++ b/tests/testthat/_snaps/base-plot/character-interpretation-of-numeric-group-level.svg @@ -18,7 +18,7 @@ - + diff --git a/tests/testthat/_snaps/base-plot/full-test-big.svg b/tests/testthat/_snaps/base-plot/full-test-big.svg index df69f63..ea77e3d 100644 --- a/tests/testthat/_snaps/base-plot/full-test-big.svg +++ b/tests/testthat/_snaps/base-plot/full-test-big.svg @@ -21,7 +21,7 @@ - + diff --git a/tests/testthat/_snaps/base-plot/full-test-small.svg b/tests/testthat/_snaps/base-plot/full-test-small.svg index e99bf79..b02f605 100644 --- a/tests/testthat/_snaps/base-plot/full-test-small.svg +++ b/tests/testthat/_snaps/base-plot/full-test-small.svg @@ -21,7 +21,7 @@ - + diff --git a/tests/testthat/_snaps/base-plot/full-test.svg b/tests/testthat/_snaps/base-plot/full-test.svg index 6758005..5eff3c4 100644 --- a/tests/testthat/_snaps/base-plot/full-test.svg +++ b/tests/testthat/_snaps/base-plot/full-test.svg @@ -18,7 +18,7 @@ - + diff --git a/tests/testthat/_snaps/base-plot/multiple-lines-for-ci-label.svg b/tests/testthat/_snaps/base-plot/multiple-lines-for-ci-label.svg index eff1d03..a9beea3 100644 --- a/tests/testthat/_snaps/base-plot/multiple-lines-for-ci-label.svg +++ b/tests/testthat/_snaps/base-plot/multiple-lines-for-ci-label.svg @@ -138,7 +138,7 @@ 0.8 1.0 Effect -CL +CL diff --git a/tests/testthat/_snaps/base-plot/no-group-level.svg b/tests/testthat/_snaps/base-plot/no-group-level.svg index 8845220..21f03d7 100644 --- a/tests/testthat/_snaps/base-plot/no-group-level.svg +++ b/tests/testthat/_snaps/base-plot/no-group-level.svg @@ -18,7 +18,7 @@ - + diff --git a/tests/testthat/_snaps/base-plot/numeric-group-level.svg b/tests/testthat/_snaps/base-plot/numeric-group-level.svg index fbafc39..5a506fb 100644 --- a/tests/testthat/_snaps/base-plot/numeric-group-level.svg +++ b/tests/testthat/_snaps/base-plot/numeric-group-level.svg @@ -18,7 +18,7 @@ - + diff --git a/tests/testthat/_snaps/base-plot/test-metagroup-with-labels.svg b/tests/testthat/_snaps/base-plot/test-metagroup-with-labels.svg index a1dedc7..99b2db6 100644 --- a/tests/testthat/_snaps/base-plot/test-metagroup-with-labels.svg +++ b/tests/testthat/_snaps/base-plot/test-metagroup-with-labels.svg @@ -18,7 +18,7 @@ - + diff --git a/tests/testthat/_snaps/base-plot/test-metagroup.svg b/tests/testthat/_snaps/base-plot/test-metagroup.svg index d0c75bc..e8a410f 100644 --- a/tests/testthat/_snaps/base-plot/test-metagroup.svg +++ b/tests/testthat/_snaps/base-plot/test-metagroup.svg @@ -18,7 +18,7 @@ - + diff --git a/tests/testthat/_snaps/base-plot/update-labels-via-yaml-file.svg b/tests/testthat/_snaps/base-plot/update-labels-via-yaml-file.svg index 290af94..9fd6f5b 100644 --- a/tests/testthat/_snaps/base-plot/update-labels-via-yaml-file.svg +++ b/tests/testthat/_snaps/base-plot/update-labels-via-yaml-file.svg @@ -18,7 +18,7 @@ - + diff --git a/tests/testthat/_snaps/nsim-plot/multiple-simulations.svg b/tests/testthat/_snaps/nsim-plot/multiple-simulations.svg index d7492b0..f547f05 100644 --- a/tests/testthat/_snaps/nsim-plot/multiple-simulations.svg +++ b/tests/testthat/_snaps/nsim-plot/multiple-simulations.svg @@ -18,7 +18,7 @@ - + From 2f2cbd80e1b8d57c0ffff2e83fc8feaf4c707b23 Mon Sep 17 00:00:00 2001 From: Kyle Barrett Date: Thu, 8 Aug 2024 10:57:59 -0400 Subject: [PATCH 6/7] remove coverage action and badge from readme --- .github/workflows/coverage.yml | 28 ---------------------------- README.Rmd | 1 - README.md | 1 - 3 files changed, 30 deletions(-) delete mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index c322c48..0000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: coverage -on: - push: - branches: - - 'main' - - 'scratch/**' - pull_request: - -jobs: - coverage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: metrumresearchgroup/actions/mpn-latest@v1 - - uses: r-lib/actions/setup-r@v2 - with: - r-version: release - use-public-rspm: true - extra-repositories: 'https://mpn.metworx.com/snapshots/stable/${{ env.MPN_LATEST }}' - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::covr - upgrade: 'TRUE' - - name: Run covr - shell: Rscript {0} - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: covr::codecov() diff --git a/README.Rmd b/README.Rmd index e921905..3bee16e 100644 --- a/README.Rmd +++ b/README.Rmd @@ -19,7 +19,6 @@ knitr::opts_chunk$set( [![Build Status](https://github.com/metrumresearchgroup/pmforest/actions/workflows/main.yaml/badge.svg)](https://github.com/metrumresearchgroup/pmforest/actions/workflows/main.yaml) -[![codecov](https://codecov.io/gh/metrumresearchgroup/pmforest/branch/main/graph/badge.svg)](https://codecov.io/gh/metrumresearchgroup/pmforest) diff --git a/README.md b/README.md index a2dea93..637851b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,6 @@ [![Build Status](https://github.com/metrumresearchgroup/pmforest/actions/workflows/main.yaml/badge.svg)](https://github.com/metrumresearchgroup/pmforest/actions/workflows/main.yaml) -[![codecov](https://codecov.io/gh/metrumresearchgroup/pmforest/branch/main/graph/badge.svg)](https://codecov.io/gh/metrumresearchgroup/pmforest) ## Installation From 31469fb0d24e993fa7f9ae27b3a2b120c0c4240b Mon Sep 17 00:00:00 2001 From: Kyle Barrett Date: Thu, 8 Aug 2024 11:43:54 -0400 Subject: [PATCH 7/7] adjust documentation for `skip_vdiffr` - This environment variable is no longer set in CI. Based on previous findings, this was necessary to avoid differences in SVG/snapshot expectation when installing various versions of `vdiffr` in CI. - This doesnt seem to be necessary now. The reasoning is unclear, but opting to _not_ set the environment variable in `.github/workflows/main.yaml` unless necessary. --- R/helpers-for-tests.R | 2 +- man/skip_vdiffr.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/helpers-for-tests.R b/R/helpers-for-tests.R index 88eea00..5ab750a 100644 --- a/R/helpers-for-tests.R +++ b/R/helpers-for-tests.R @@ -1,4 +1,4 @@ -#' Skip test if not on Metworx or CI +#' Skip test if `PMF_SKIP_VDIFFR` environment variable set to `TRUE` #' #' Checks for custom `PMF_SKIP_VDIFFR` environment variable and skips any tests #' that use `vdiffr` if set to `"true"`. This is useful because diff --git a/man/skip_vdiffr.Rd b/man/skip_vdiffr.Rd index 9eb31d6..0e9af5b 100644 --- a/man/skip_vdiffr.Rd +++ b/man/skip_vdiffr.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/helpers-for-tests.R \name{skip_vdiffr} \alias{skip_vdiffr} -\title{Skip test if not on Metworx or CI} +\title{Skip test if \code{PMF_SKIP_VDIFFR} environment variable set to \code{TRUE}} \usage{ skip_vdiffr() }