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
8 changes: 8 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ on:
branches: [main, dev]
pull_request:
branches: [main, dev]
paths:
- '**.R'
- '**.Rmd'
- DESCRIPTION
- NAMESPACE
- man/**
- R/**
- tests/**
workflow_dispatch:

name: R-CMD-check
Expand Down
52 changes: 0 additions & 52 deletions .github/workflows/document.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ on:
branches: [main, dev]
pull_request:
branches: [main, dev]
paths:
- '**.R'
- '**.Rmd'
- DESCRIPTION
- NAMESPACE
- man/**
- R/**
workflow_dispatch:

name: lint
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ on:
branches: [main, dev]
pull_request:
branches: [main, dev]
paths:
- '**.R'
- '**.Rmd'
- DESCRIPTION
- NAMESPACE
- man/**
- R/**
- _pkgdown.yml
release:
types: [published]
workflow_dispatch:
Expand Down
149 changes: 149 additions & 0 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# 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
# Modifications:
# - Allow more roles to trigger each PR command
# - Document builds README.md from README.Rmd with devtools::build_readme()
# - Include a doc-preview command (uses Netlify to preview the docs)
on:
issue_comment:
types: [created]

name: pr-commands.yaml

permissions: read-all

jobs:
document:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'CONTRIBUTOR' || 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 }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- 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
with:
extra-packages: any::roxygen2
needs: pr-document

- name: Document
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: Build README.md from README.Rmd
run: Rscript -e 'if (file.exists("README.Rmd")) devtools::build_readme()'

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add man/\* NAMESPACE
git commit -m 'Document'

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

style:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'CONTRIBUTOR' || 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 }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

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

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

- name: Install dependencies
run: install.packages("styler")
shell: Rscript {0}

- name: Style
run: styler::style_pkg()
shell: Rscript {0}

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add \*.R
git commit -m 'Style'

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

preview:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'CONTRIBUTOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/preview-docs') }}

runs-on: ubuntu-latest
permissions:
# Needed to write a comment on the PR
pull-requests: write
# Needed to read the PR branch
contents: read
steps:
- uses: actions/checkout@v4
with:
# Checkout the PR branch
ref: refs/pull/${{ github.event.issue.number }}/head

- 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 Netlify
uses: nwtgck/[email protected]
with:
# Standard config
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
# 'docs/' is the default directory for pkgdown::build_site()
# we add 'dev' because _pkgdown.yml has 'development: mode: devel'
publish-dir: './docs/dev'
# Development deploys only
production-deploy: false
# Enable pull request comment (default)
enable-pull-request-comment: true
# Overwrite the pull request comment with updated link (default)
overwrites-pull-request-comment: true
# Don't deploy to GitHub
enable-github-deployment: false
# Don't update the status of the commit
enable-commit-status: false
# Don't comment on the commit
enable-commit-comment: false
env:
# Netlify credentials (currently from Dmitry's account)
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
82 changes: 0 additions & 82 deletions .github/workflows/style.yaml

This file was deleted.

9 changes: 8 additions & 1 deletion .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ on:
push:
branches: [main, dev]
pull_request:

paths:
- '**.R'
- '**.Rmd'
- DESCRIPTION
- NAMESPACE
- man/**
- R/**
- tests/**
name: test-coverage

jobs:
Expand Down