From f2efda4210a71aa395dedddd3ca798b7109f6ea0 Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Sat, 2 May 2026 17:56:13 -0400 Subject: [PATCH 1/3] Update CI --- .github/workflows/R-CMD-check.yaml | 50 +++++++++++++++++++++++ .github/workflows/blank.yml | 17 -------- .github/workflows/pkgdown.yaml | 13 +++--- .github/workflows/test-coverage.yaml | 60 ++++++++++++++++++++++++++++ .travis.yml | 1 - README.md | 15 ++++--- _pkgdown.yml | 3 -- 7 files changed, 126 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/R-CMD-check.yaml delete mode 100644 .github/workflows/blank.yml create mode 100644 .github/workflows/test-coverage.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..73bfb21 --- /dev/null +++ b/.github/workflows/R-CMD-check.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: + +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@v6 + + - 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 }} + + - 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/blank.yml b/.github/workflows/blank.yml deleted file mode 100644 index b2340b2..0000000 --- a/.github/workflows/blank.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: CI - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Run a one-line script - run: echo Hello, world! - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 087f0b0..16c6c8b 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -4,12 +4,13 @@ on: push: branches: [main, master] pull_request: - branches: [main, master] release: types: [published] workflow_dispatch: -name: pkgdown +name: pkgdown.yaml + +permissions: read-all jobs: pkgdown: @@ -19,14 +20,14 @@ jobs: group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - 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: @@ -39,7 +40,7 @@ jobs: - name: Deploy to GitHub pages 🚀 if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.4.1 + uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0 with: clean: false branch: gh-pages diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..fcbff56 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,60 @@ +# 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: + +name: test-coverage.yaml + +permissions: read-all + +jobs: + test-coverage: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v6 + + - uses: r-lib/actions/setup-r@v2 + + - 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") + ) + print(cov) + covr::to_cobertura(cov) + shell: Rscript {0} + + - uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6 + with: + # Fail if error if not on PR, or if on PR and token is given + fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} + files: ./cobertura.xml + plugins: 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@v7 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e837f5d..0000000 --- a/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: r diff --git a/README.md b/README.md index f48bcd5..ab42c67 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,24 @@ # pmxTools Pharmacometric Tools for Modeling & Simulation -[![Build Status](https://app.travis-ci.com/kestrel99/pmxTools.png?branch=master)](https://app.travis-ci.com/kestrel99/pmxTools) + +[![R-CMD-check](https://github.com/kestrel99/pmxTools/actions/workflows/R-CMD-check.yaml/badge.svghttps://github.com/kestrel99/pmxTools/actions/workflows/R-CMD-check.yaml/badge.svghttps://github.com/kestrel99/pmxTools/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/kestrel99/pmxTools/actions/workflows/R-CMD-check.yaml) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/kestrel99/pmxTools/issues) [![](https://www.r-pkg.org/badges/version/pmxTools?color=green)](https://cran.r-project.org/package=pmxTools) [![](http://cranlogs.r-pkg.org/badges/grand-total/pmxTools?color=blue)](https://cran.r-project.org/package=pmxTools) +[![Codecov test coverage](https://codecov.io/gh/kestrel99/pmxTools/graph/badge.svg)](https://app.codecov.io/gh/kestrel99/pmxTools) + Developed by **Justin Wilkins**, **Bill Denney** and **Rik Schoemaker**, with contributions from a host of others. -Pharmacometric tools for common data analytical tasks; closed-form solutions for calculating concentrations at given - times after dosing based on compartmental PK models (1-compartment, 2-compartment and 3-compartment, covering infusions, zero- - and first-order absorption, and lag times, after single doses and at steady state, per Bertrand & Mentre (2008) - ); parametric simulation from NONMEM-generated parameter estimates +Pharmacometric tools for common data analytical tasks; closed-form solutions for calculating concentrations at given + times after dosing based on compartmental PK models (1-compartment, 2-compartment and 3-compartment, covering infusions, zero- + and first-order absorption, and lag times, after single doses and at steady state, per Bertrand & Mentre (2008) + ); parametric simulation from NONMEM-generated parameter estimates and other output; and parsing, tabulating and plotting results generated by Perl-speaks-NONMEM (PsN). - + To install: ```{r} diff --git a/_pkgdown.yml b/_pkgdown.yml index 87bddcc..bd4f4f5 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,6 +1,3 @@ url: https://kestrel99.github.io/pmxTools/ template: bootstrap: 5 - -development: - mode: auto \ No newline at end of file From 4128fc26e10085169207bf913a314eade664740b Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Sat, 2 May 2026 17:58:17 -0400 Subject: [PATCH 2/3] Fix R version (thanks to @MichaelChirico) --- DESCRIPTION | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 21996b8..00da387 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,10 +13,10 @@ Authors@R: c(person("Justin", "Wilkins", email = "justin.wilkins@occams.com", ro person("John", "Johnson", email="johndjohnson@gmail.com", role="ctb")) Maintainer: Justin Wilkins Contact: Justin Wilkins -Description: Pharmacometric tools for common data analytical tasks; closed-form solutions for calculating concentrations at given - times after dosing based on compartmental PK models (1-compartment, 2-compartment and 3-compartment, covering infusions, zero- - and first-order absorption, and lag times, after single doses and at steady state, per Bertrand & Mentre (2008) - ); parametric simulation from NONMEM-generated parameter estimates +Description: Pharmacometric tools for common data analytical tasks; closed-form solutions for calculating concentrations at given + times after dosing based on compartmental PK models (1-compartment, 2-compartment and 3-compartment, covering infusions, zero- + and first-order absorption, and lag times, after single doses and at steady state, per Bertrand & Mentre (2008) + ); parametric simulation from NONMEM-generated parameter estimates and other output; and parsing, tabulating and plotting results generated by Perl-speaks-NONMEM (PsN). License: GPL-2 URL: https://github.com/kestrel99/pmxTools, @@ -40,9 +40,9 @@ Imports: magrittr, data.tree Depends: - R (>= 4.00), + R (>= 4.0.0), patchwork -Suggests: +Suggests: testthat, vdiffr, knitr, From 9eacd4069b501230ecb7e305f7bc3f5c53b7928f Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Sat, 2 May 2026 18:02:59 -0400 Subject: [PATCH 3/3] Add code coverage --- .Rbuildignore | 1 + codecov.yml | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 codecov.yml diff --git a/.Rbuildignore b/.Rbuildignore index f6506d1..b1ef68f 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,3 +12,4 @@ pmxTools.Rproj ^docs$ ^pkgdown$ ^\.github$ +^codecov\.yml$ diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..04c5585 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +comment: false + +coverage: + status: + project: + default: + target: auto + threshold: 1% + informational: true + patch: + default: + target: auto + threshold: 1% + informational: true