-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use tidy configuration for gh actions
- Loading branch information
Showing
9 changed files
with
272 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
^\.travis\.yml$ | ||
^appveyor\.yml$ | ||
^\.github$ | ||
^codecov\.yml$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
|
||
name: pkgdown | ||
|
||
jobs: | ||
pkgdown: | ||
runs-on: ubuntu-18.04 | ||
env: | ||
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v1 | ||
id: install-r | ||
|
||
- uses: r-lib/actions/setup-pandoc@v1 | ||
|
||
- name: Install pak and query dependencies | ||
run: | | ||
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") | ||
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds") | ||
shell: Rscript {0} | ||
|
||
- name: Restore R package cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
${{ env.R_LIBS_USER }}/* | ||
!${{ env.R_LIBS_USER }}/pak | ||
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} | ||
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1- | ||
|
||
- name: Install system dependencies | ||
if: runner.os == 'Linux' | ||
run: | | ||
pak::local_system_requirements(execute = TRUE) | ||
pak::pkg_system_requirements("pkgdown", execute = TRUE) | ||
shell: Rscript {0} | ||
|
||
- name: Install dependencies | ||
run: | | ||
pak::local_install_dev_deps(upgrade = TRUE, dependencies = c("all", "Config/Needs/website")) | ||
pak::pkg_install("pkgdown") | ||
shell: Rscript {0} | ||
|
||
- name: Install package | ||
run: R CMD INSTALL . | ||
|
||
- name: Build and deploy pkgdown site | ||
run: | | ||
git config --local user.name "$GITHUB_ACTOR" | ||
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
on: | ||
issue_comment: | ||
types: [created] | ||
name: Commands | ||
jobs: | ||
document: | ||
if: startsWith(github.event.comment.body, '/document') | ||
name: document | ||
runs-on: macOS-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: r-lib/actions/pr-fetch@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: r-lib/actions/setup-r@v1 | ||
- name: Install dependencies | ||
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)' | ||
- name: Document | ||
run: Rscript -e 'roxygen2::roxygenise()' | ||
- name: commit | ||
run: | | ||
git config --local user.email "actions@github.com" | ||
git config --local user.name "GitHub Actions" | ||
git add man/\* NAMESPACE | ||
git commit -m 'Document' | ||
- uses: r-lib/actions/pr-push@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
style: | ||
if: startsWith(github.event.comment.body, '/style') | ||
name: style | ||
runs-on: macOS-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: r-lib/actions/pr-fetch@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: r-lib/actions/setup-r@v1 | ||
- name: Install dependencies | ||
run: Rscript -e 'install.packages("styler")' | ||
- name: Style | ||
run: Rscript -e 'styler::style_pkg()' | ||
- name: commit | ||
run: | | ||
git config --local user.email "actions@github.com" | ||
git config --local user.name "GitHub Actions" | ||
git add \*.R | ||
git commit -m 'Style' | ||
- uses: r-lib/actions/pr-push@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
|
||
name: test-coverage | ||
|
||
jobs: | ||
test-coverage: | ||
runs-on: ubuntu-18.04 | ||
env: | ||
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v1 | ||
id: install-r | ||
|
||
- name: Install pak and query dependencies | ||
run: | | ||
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") | ||
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds") | ||
shell: Rscript {0} | ||
|
||
- name: Restore R package cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
${{ env.R_LIBS_USER }}/* | ||
!${{ env.R_LIBS_USER }}/pak | ||
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} | ||
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1- | ||
|
||
- name: Install system dependencies | ||
if: runner.os == 'Linux' | ||
run: | | ||
pak::local_system_requirements(execute = TRUE) | ||
pak::pkg_system_requirements("covr", execute = TRUE) | ||
shell: Rscript {0} | ||
|
||
- name: Install dependencies | ||
run: | | ||
pak::local_install_dev_deps(upgrade = TRUE) | ||
pak::pkg_install("covr") | ||
shell: Rscript {0} | ||
|
||
- name: Test coverage | ||
run: covr::codecov() | ||
shell: Rscript {0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
comment: false | ||
|
||
coverage: | ||
status: | ||
project: | ||
default: | ||
target: auto | ||
threshold: 1% | ||
informational: true | ||
patch: | ||
default: | ||
target: auto | ||
threshold: 1% | ||
informational: true |