From 4f1597cc00aa0e39fe009f629f15ce73bbafa7cd Mon Sep 17 00:00:00 2001 From: Claire Lunch Date: Tue, 10 Feb 2026 15:35:53 -0700 Subject: [PATCH 1/8] Create r.yml Enable GitHub Actions to test the package on push/PR to main or dev. --- .github/workflows/r.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 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..05ea977 --- /dev/null +++ b/.github/workflows/r.yml @@ -0,0 +1,40 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# +# See https://github.com/r-lib/actions/tree/master/examples#readme for +# additional example workflows available for the R community. + +name: R + +on: + push: + branches: [ "main", "dev" ] + pull_request: + branches: [ "main", "dev" ] + +permissions: + contents: read + +jobs: + build: + runs-on: macos-latest + strategy: + matrix: + r-version: ['4.5.1'] + + steps: + - uses: actions/checkout@v4 + - name: Set up R ${{ matrix.r-version }} + uses: r-lib/actions/setup-r@f57f1301a053485946083d7a45022b278929a78a + with: + r-version: ${{ matrix.r-version }} + - name: Install dependencies + run: | + install.packages(c("remotes", "rcmdcheck")) + remotes::install_deps(dependencies = TRUE) + shell: Rscript {0} + - name: Check + run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error") + shell: Rscript {0} From d2e258a4f5ba256b06a6d8b60485c8c8a5a701f3 Mon Sep 17 00:00:00 2001 From: Claire Lunch Date: Tue, 10 Feb 2026 15:42:04 -0700 Subject: [PATCH 2/8] Update r.yml --- .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 05ea977..0c71532 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -22,7 +22,7 @@ jobs: runs-on: macos-latest strategy: matrix: - r-version: ['4.5.1'] + r-version: ['4.5.0'] steps: - uses: actions/checkout@v4 From eb1e7c9d9b2a10f9f9eb85a425b14a84f4d7138c Mon Sep 17 00:00:00 2001 From: Claire Lunch Date: Tue, 10 Feb 2026 15:50:58 -0700 Subject: [PATCH 3/8] Update r.yml --- .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 0c71532..59fff98 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -19,7 +19,7 @@ permissions: jobs: build: - runs-on: macos-latest + runs-on: macos-15 strategy: matrix: r-version: ['4.5.0'] From be8141885fd30ad71f6a39b43e3d5bf77ce9085f Mon Sep 17 00:00:00 2001 From: Claire Lunch Date: Tue, 10 Feb 2026 16:01:01 -0700 Subject: [PATCH 4/8] Update r.yml --- .github/workflows/r.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index 59fff98..998ea01 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -19,10 +19,10 @@ permissions: jobs: build: - runs-on: macos-15 + runs-on: macos-latest strategy: matrix: - r-version: ['4.5.0'] + r-version: ['release'] steps: - uses: actions/checkout@v4 From 2ed3a9dfa264b1553c67800d983e86488486dcd4 Mon Sep 17 00:00:00 2001 From: Claire Lunch Date: Tue, 10 Feb 2026 16:12:10 -0700 Subject: [PATCH 5/8] Update r.yml trying check-r-package from r-lib --- .github/workflows/r.yml | 105 +++++++++++++++++++++++++++------------- 1 file changed, 72 insertions(+), 33 deletions(-) diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index 998ea01..96d8819 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -1,40 +1,79 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# -# See https://github.com/r-lib/actions/tree/master/examples#readme for -# additional example workflows available for the R community. +name: 'check-r-package' +description: 'Action to check R package with rcmdcheck. Assumes that rcmdcheck has already been installed.' +author: 'Jim Hester' +inputs: + args: + description: 'Arguments to pass to the `args` parameter of rcmdcheck. Must be an R expression. Note that it often needs to be quoted in YAML, see the README for details.' + default: 'c("--no-manual", "--as-cran")' + build_args: + description: 'Arguments to pass to the `build_args` parameter of rcmdcheck. Note that it often needs to be quoted in YAML, see the README for details.' + default: '"--no-manual"' + error-on: + description: 'What type of result should cause a build error? Note that it often needs to be quoted in YAML, see the README for details.' + default: '"warning"' + check-dir: + description: 'Where should the check output go? Note that it often needs to be quoted in YAML, see the README for details.' + default: '"check"' + working-directory: + description: 'Using the working-directory keyword, you can specify the working directory of where "rcmdcheck::rcmdcheck" is run.' + default: '.' + upload-snapshots: + description: | + Whether to upload all testthat snapshots as an artifact. Possible values are 'true', + 'false', 'always'. + default: false + upload-results: + description: | + Whether to upload check results for successful runs too. If 'never', + then it does not upload the results, even on failure. + default: false + artifact-name: + description: | + Use this to override the default artifact name for the check results. + snapshot-artifact-name: + description: | + Use this to override the default artifact name for testthat snapshots. -name: R +runs: + using: "composite" + steps: + - name: Check + id: rcmdcheck + run: | + ## -------------------------------------------------------------------- + options(crayon.enabled = TRUE) + cat("LOGNAME=", Sys.info()[["user"]], "\n", sep = "", file = Sys.getenv("GITHUB_ENV"), append = TRUE) + if (Sys.getenv("_R_CHECK_FORCE_SUGGESTS_", "") == "") Sys.setenv("_R_CHECK_FORCE_SUGGESTS_" = "false") + if (Sys.getenv("_R_CHECK_CRAN_INCOMING_", "") == "") Sys.setenv("_R_CHECK_CRAN_INCOMING_" = "false") + cat("check-dir-path=", file.path(getwd(), (${{ inputs.check-dir }})), "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE) + check_results <- rcmdcheck::rcmdcheck(args = (${{ inputs.args }}), build_args = (${{ inputs.build_args }}), error_on = (${{ inputs.error-on }}), check_dir = (${{ inputs.check-dir }})) + shell: Rscript {0} + working-directory: ${{ inputs.working-directory }} -on: - push: - branches: [ "main", "dev" ] - pull_request: - branches: [ "main", "dev" ] + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + echo ::group::Show testthat output + find check -name 'testthat.Rout*' -exec cat '{}' \; || true + echo ::endgroup:: + shell: bash + working-directory: ${{ inputs.working-directory }} -permissions: - contents: read + - name: Upload check results + if: ${{ (failure() && inputs.upload-results != 'never') || (inputs.upload-results != 'false' && inputs.upload-results != 'never') }} + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.artifact-name || format('{0}-{1}-r{2}-{3}-results', runner.os, runner.arch, matrix.config.r, matrix.config.id || strategy.job-index ) }} + path: ${{ steps.rcmdcheck.outputs.check-dir-path }} -jobs: - build: - runs-on: macos-latest - strategy: - matrix: - r-version: ['release'] - - steps: - - uses: actions/checkout@v4 - - name: Set up R ${{ matrix.r-version }} - uses: r-lib/actions/setup-r@f57f1301a053485946083d7a45022b278929a78a - with: - r-version: ${{ matrix.r-version }} - - name: Install dependencies - run: | - install.packages(c("remotes", "rcmdcheck")) - remotes::install_deps(dependencies = TRUE) - shell: Rscript {0} + - name: Upload snapshots + if: ${{ (failure() && inputs.upload-snapshots == 'always') || inputs.upload-snapshots != 'false' }} + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.snapshot-artifact-name || format('{0}-{1}-r{2}-{3}-testthat-snapshots', runner.os, runner.arch, matrix.config.r, matrix.config.id || strategy.job-index ) }} + path: ${{ steps.rcmdcheck.outputs.check-dir-path }}/**/tests*/testthat/_snaps + if-no-files-found: ignore - name: Check run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error") shell: Rscript {0} From 1aa2813e6f72c9d2be8308ec4d1c08505e2ae5f4 Mon Sep 17 00:00:00 2001 From: Claire Lunch Date: Tue, 10 Feb 2026 16:17:46 -0700 Subject: [PATCH 6/8] trying usethis github actions setup --- .Rbuildignore | 1 + .github/.gitignore | 1 + .github/workflows/R-CMD-check.yaml | 33 +++++++++++++ .github/workflows/r.yml | 79 ------------------------------ 4 files changed, 35 insertions(+), 79 deletions(-) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/R-CMD-check.yaml delete mode 100644 .github/workflows/r.yml diff --git a/.Rbuildignore b/.Rbuildignore index 5716143..63bd3f5 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -4,3 +4,4 @@ ^README\.Rmd$ ^cran-comments\.md$ ^dev_scripts$ +^\.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..0309311 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,33 @@ +# 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, dev] + pull_request: + +name: R-CMD-check.yaml + +permissions: read-all + +jobs: + R-CMD-check: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + 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::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/r.yml b/.github/workflows/r.yml deleted file mode 100644 index 96d8819..0000000 --- a/.github/workflows/r.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: 'check-r-package' -description: 'Action to check R package with rcmdcheck. Assumes that rcmdcheck has already been installed.' -author: 'Jim Hester' -inputs: - args: - description: 'Arguments to pass to the `args` parameter of rcmdcheck. Must be an R expression. Note that it often needs to be quoted in YAML, see the README for details.' - default: 'c("--no-manual", "--as-cran")' - build_args: - description: 'Arguments to pass to the `build_args` parameter of rcmdcheck. Note that it often needs to be quoted in YAML, see the README for details.' - default: '"--no-manual"' - error-on: - description: 'What type of result should cause a build error? Note that it often needs to be quoted in YAML, see the README for details.' - default: '"warning"' - check-dir: - description: 'Where should the check output go? Note that it often needs to be quoted in YAML, see the README for details.' - default: '"check"' - working-directory: - description: 'Using the working-directory keyword, you can specify the working directory of where "rcmdcheck::rcmdcheck" is run.' - default: '.' - upload-snapshots: - description: | - Whether to upload all testthat snapshots as an artifact. Possible values are 'true', - 'false', 'always'. - default: false - upload-results: - description: | - Whether to upload check results for successful runs too. If 'never', - then it does not upload the results, even on failure. - default: false - artifact-name: - description: | - Use this to override the default artifact name for the check results. - snapshot-artifact-name: - description: | - Use this to override the default artifact name for testthat snapshots. - -runs: - using: "composite" - steps: - - name: Check - id: rcmdcheck - run: | - ## -------------------------------------------------------------------- - options(crayon.enabled = TRUE) - cat("LOGNAME=", Sys.info()[["user"]], "\n", sep = "", file = Sys.getenv("GITHUB_ENV"), append = TRUE) - if (Sys.getenv("_R_CHECK_FORCE_SUGGESTS_", "") == "") Sys.setenv("_R_CHECK_FORCE_SUGGESTS_" = "false") - if (Sys.getenv("_R_CHECK_CRAN_INCOMING_", "") == "") Sys.setenv("_R_CHECK_CRAN_INCOMING_" = "false") - cat("check-dir-path=", file.path(getwd(), (${{ inputs.check-dir }})), "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE) - check_results <- rcmdcheck::rcmdcheck(args = (${{ inputs.args }}), build_args = (${{ inputs.build_args }}), error_on = (${{ inputs.error-on }}), check_dir = (${{ inputs.check-dir }})) - shell: Rscript {0} - working-directory: ${{ inputs.working-directory }} - - - name: Show testthat output - if: always() - run: | - ## -------------------------------------------------------------------- - echo ::group::Show testthat output - find check -name 'testthat.Rout*' -exec cat '{}' \; || true - echo ::endgroup:: - shell: bash - working-directory: ${{ inputs.working-directory }} - - - name: Upload check results - if: ${{ (failure() && inputs.upload-results != 'never') || (inputs.upload-results != 'false' && inputs.upload-results != 'never') }} - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.artifact-name || format('{0}-{1}-r{2}-{3}-results', runner.os, runner.arch, matrix.config.r, matrix.config.id || strategy.job-index ) }} - path: ${{ steps.rcmdcheck.outputs.check-dir-path }} - - - name: Upload snapshots - if: ${{ (failure() && inputs.upload-snapshots == 'always') || inputs.upload-snapshots != 'false' }} - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.snapshot-artifact-name || format('{0}-{1}-r{2}-{3}-testthat-snapshots', runner.os, runner.arch, matrix.config.r, matrix.config.id || strategy.job-index ) }} - path: ${{ steps.rcmdcheck.outputs.check-dir-path }}/**/tests*/testthat/_snaps - if-no-files-found: ignore - - name: Check - run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error") - shell: Rscript {0} From 4862ecea049203ba10c219d0b1f0d3aeb206ea1b Mon Sep 17 00:00:00 2001 From: Claire Lunch Date: Tue, 10 Feb 2026 16:21:38 -0700 Subject: [PATCH 7/8] Update R-CMD-check.yaml --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 0309311..f087a35 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -2,7 +2,7 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: [main, master, dev] + branches: [main, master] pull_request: name: R-CMD-check.yaml From 8ef328a3521a5639fcf2e8cb5bf0ea707d36faf4 Mon Sep 17 00:00:00 2001 From: Claire Lunch Date: Wed, 11 Feb 2026 08:58:44 -0700 Subject: [PATCH 8/8] Update R-CMD-check.yaml --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index f087a35..0309311 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -2,7 +2,7 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: [main, master] + branches: [main, master, dev] pull_request: name: R-CMD-check.yaml