Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,17 @@ jobs:
- {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
- uses: ./.github/workflows/install
with:
token: ${{ secrets.GITHUB_TOKEN }}
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
extra-packages: any::rcmdcheck
cache-version: "1"

- uses: r-lib/actions/check-r-package@v2
with:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Copilot Setup Steps"

# Automatically run when the file changes to allow for easy validation,
# and allow manual testing through the repository's "Actions" tab.
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest

# Lowest permissions needed; Copilot gets its own token for its operations.
permissions:
contents: read

steps:
- uses: actions/checkout@v6

- uses: ./.github/workflows/install
with:
token: ${{ secrets.GITHUB_TOKEN }}
cache-version: copilot
needs: build, check, website
extra-packages: any::rcmdcheck any::roxygen2 any::pkgdown local::.

- name: Install air
uses: posit-dev/setup-air@v1
45 changes: 45 additions & 0 deletions .github/workflows/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Install R and dependencies"
description: "Set up pandoc, R, and package dependencies"
inputs:
token:
description: "GitHub token, set to secrets.GITHUB_TOKEN"
required: true
r-version:
description: "R version, passed to r-lib/actions/setup-r@v2"
required: false
default: release
http-user-agent:
description: "HTTP user agent, passed to r-lib/actions/setup-r@v2"
required: false
default: ""
needs:
description: "Config/Needs tag(s), passed to r-lib/actions/setup-r-dependencies@v2"
required: false
default: ""
extra-packages:
description: "Extra packages, passed to r-lib/actions/setup-r-dependencies@v2"
required: false
default: any::rcmdcheck
cache-version:
description: "Cache version for r-lib/actions/setup-r-dependencies@v2"
required: false
default: "1"

runs:
using: "composite"
steps:
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ inputs.r-version }}
http-user-agent: ${{ inputs.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
env:
GITHUB_PAT: ${{ inputs.token }}
with:
needs: ${{ inputs.needs }}
extra-packages: ${{ inputs.extra-packages }}
cache-version: ${{ inputs.cache-version }}
14 changes: 4 additions & 10 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,17 @@ jobs:
# 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@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
- uses: ./.github/workflows/install
with:
extra-packages: any::pkgdown, local::.
token: ${{ secrets.GITHUB_TOKEN }}
needs: website
extra-packages: any::pkgdown local::.
cache-version: "1"

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,19 @@ jobs:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
name: document
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6

- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
- uses: ./.github/workflows/install
with:
extra-packages: any::roxygen2
token: ${{ secrets.GITHUB_TOKEN }}
needs: pr-document
extra-packages: any::roxygen2
cache-version: "1"

- name: Document
run: roxygen2::roxygenise()
Expand All @@ -48,8 +44,6 @@ jobs:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
name: style
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6

Expand All @@ -59,13 +53,12 @@ jobs:

- uses: r-lib/actions/setup-r@v2

- name: Install dependencies
run: install.packages("styler")
shell: Rscript {0}
- name: Install air
uses: posit-dev/setup-air@v1

- name: Style
run: styler::style_pkg()
shell: Rscript {0}
run: air format .
shell: bash

- name: commit
run: |
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,41 @@ name: test-coverage
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
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
- uses: ./.github/workflows/install
with:
extra-packages: any::covr
token: ${{ secrets.GITHUB_TOKEN }}
needs: coverage
extra-packages: any::covr
cache-version: "1"

- name: Test coverage
run: |
covr::codecov(
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
print(cov)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v5
with:
# Fail if error if not on PR, or if on PR and token is given
Comment thread
jonthegeek marked this conversation as resolved.
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
plugins: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
Comment thread
jonthegeek marked this conversation as resolved.

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
Expand Down