forked from rstudio/shiny
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop GHA pr-commands and add GHA Rituals. Use pak to install (rstudio…
…#3230) Co-authored-by: Winston Chang <[email protected]> Co-authored-by: Barret Schloerke <[email protected]>
- Loading branch information
Showing
5 changed files
with
166 additions
and
132 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
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,130 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- ghactions | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
name: Rituals | ||
|
||
jobs: | ||
rituals: | ||
name: Rituals | ||
# if: false | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { os: ubuntu-16.04, r: '4.0', rspm: "https://packagemanager.rstudio.com/all/__linux__/xenial/latest"} | ||
|
||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
RSPM: ${{ matrix.config.rspm }} | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- uses: r-lib/actions/pr-fetch@master | ||
name: Git Pull (PR) | ||
if: github.event_name == 'pull_request' | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: r-lib/actions/setup-r@master | ||
id: install-r | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
|
||
- uses: r-lib/actions/setup-pandoc@master | ||
|
||
- name: Git Config | ||
run: | | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
- name: Install pak and query dependencies | ||
shell: Rscript {0} | ||
run: | | ||
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") | ||
saveRDS(pak::pkg_deps_tree("local::.", dependencies = TRUE), ".github/r-depends.rds") | ||
- name: Cache R packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.R_LIBS_USER }} | ||
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} | ||
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1- | ||
|
||
- name: Install system dependencies | ||
# if: runner.os == 'Linux' | ||
shell: Rscript {0} | ||
run: | | ||
pak::local_system_requirements(execute = TRUE) | ||
- name: Install dependencies | ||
shell: Rscript {0} | ||
run: | | ||
pak::local_install_dev_deps(upgrade = TRUE) | ||
pak::pkg_install("sessioninfo") | ||
pak::pkg_install("devtools") | ||
- name: Session info | ||
shell: Rscript {0} | ||
run: | | ||
options(width = 100) | ||
pkgs <- installed.packages()[, "Package"] | ||
sessioninfo::session_info(pkgs, include_base = TRUE) | ||
- name: Document | ||
run: | | ||
Rscript -e 'devtools::document()' | ||
git add man/\* NAMESPACE | ||
git commit -m 'Document (GitHub Actions)' || echo "No documentation changes to commit" | ||
- name: Check documentation | ||
run: | | ||
./tools/documentation/checkDocsCurrent.sh | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12.x' | ||
# https://github.com/actions/cache/blame/ccf96194800dbb7b7094edcd5a7cf3ec3c270f10/examples.md#L185-L200 | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- name: yarn cache | ||
uses: actions/cache@v2 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ matrix.config.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ matrix.config.os }}-yarn- | ||
- name: Build JS | ||
run: | | ||
cd tools | ||
yarn install --frozen-lockfile | ||
yarn build | ||
git add ../inst | ||
git commit -m 'yarn build (GitHub Actions)' || echo "No yarn changes to commit" | ||
- name: Check node build | ||
run: | | ||
./tools/checkJSCurrent.sh | ||
- name: Git Push (PR) | ||
uses: r-lib/actions/pr-push@master | ||
if: github.event_name == 'pull_request' | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Git Push (MASTER) | ||
if: github.event_name == 'push' | ||
run: | | ||
git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{ github.ref }} || echo "No changes to push" |
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 |
---|---|---|
|
@@ -10,3 +10,6 @@ shinyapps/ | |
README.html | ||
.*.Rnb.cached | ||
tools/yarn-error.log | ||
|
||
# GHA remotes installation | ||
.github/r-depends.rds |
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