Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INFRA] Add a new job to regenerate the .Rd documentation on each PR #59

Closed
wants to merge 3 commits into from
Closed
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
59 changes: 59 additions & 0 deletions .github/workflows/regenerate_Rd_documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Regenerate the .Rd documentation

on:
pull_request:
branches:
- main

jobs:
regenerate_Rd_documentation:
runs-on: ubuntu-20.04
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest

steps:
- uses: actions/checkout@v2

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

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Restore R package cache
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("devtools")
shell: Rscript {0}

- name: Build the source package
run: Rscript -e 'devtools::document()'

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update the .Rd documentation
file_pattern: man/*.Rd
commit_user_name: process-analytics-bot
commit_user_email: [email protected]
commit_author: "process-analytics-bot <[email protected]>"
status_options: '--untracked-files=yes'