From b08488c7bd2c77698f3cc77fdf2db1bda3d19952 Mon Sep 17 00:00:00 2001 From: Joe Thorley Date: Mon, 22 Jun 2026 15:52:08 -0700 Subject: [PATCH] Standardize CI via reusable workflows (tier: unimportant) Replace ad hoc workflows with thin callers to the reusable CI in poissonconsulting/.github (R-CMD-check, test-coverage, pkgdown), keeping the fledge callers. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/R-CMD-check.yaml | 32 ++++++----------- .github/workflows/pkgdown.yaml | 45 ++++------------------- .github/workflows/test-coverage.yaml | 53 +++++----------------------- 3 files changed, 26 insertions(+), 104 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 57589a5..0458c80 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,29 +1,17 @@ -# 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 +name: R-CMD-check on: push: branches: [main, master] pull_request: branches: [main, master] - -name: R-CMD-check - +permissions: + contents: read jobs: R-CMD-check: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes - steps: - - uses: actions/checkout@v5 - - - 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 + uses: poissonconsulting/.github/.github/workflows/R-CMD-check.yaml@v1 + with: + tier: unimportant + jags: false + tex: false + private: false + secrets: inherit diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 3603cd3..78fd5be 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -1,5 +1,4 @@ -# 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 +name: pkgdown on: push: branches: [main, master] @@ -8,41 +7,11 @@ on: release: types: [published] workflow_dispatch: - -name: pkgdown - +permissions: + contents: write jobs: pkgdown: - runs-on: ubuntu-latest - # Only restrict concurrency for non-PR jobs - concurrency: - group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - permissions: - contents: write - steps: - - uses: actions/checkout@v5 - - - 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: - extra-packages: any::pkgdown, local::. - needs: website - - - name: Build site - run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) - shell: Rscript {0} - - - name: Deploy to GitHub pages 🚀 - if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.7.3 - with: - clean: false - branch: gh-pages - folder: docs + uses: poissonconsulting/.github/.github/workflows/pkgdown.yaml@v1 + with: + private: false + secrets: inherit diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index bd8a338..dac8c3d 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,50 +1,15 @@ -# 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 +name: test-coverage on: push: branches: [main, master] pull_request: branches: [main, master] - -name: coverage - +permissions: + contents: read jobs: - coverage: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v5 - - - 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(Sys.getenv("RUNNER_TEMP"), "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@v4 - with: - name: coverage-test-failures - path: ${{ runner.temp }}/package + test-coverage: + uses: poissonconsulting/.github/.github/workflows/test-coverage.yaml@v1 + with: + tex: false + private: false + secrets: inherit