-
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.
- Loading branch information
Showing
25 changed files
with
1,739 additions
and
1,593 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
source("renv/activate.R") |
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 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,95 @@ | ||
# from: https://github.com/rstudio/shiny-testing-gha-example/blob/single_platform_snapshot/.github/workflows/run-tests.yaml | ||
on: | ||
push: | ||
paths: | ||
- 'renv.lock' | ||
|
||
name: Update `manifest.json` | ||
|
||
jobs: | ||
manifest: | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
name: Sync manifest.json with renv.lock | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
# Match your manifest file R version | ||
- {os: ubuntu-18.04, r: '4.0.2', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} | ||
|
||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
RSPM: ${{ matrix.config.rspm }} | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- uses: r-lib/actions/setup-r@master | ||
id: install-r | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
|
||
- uses: r-lib/actions/setup-pandoc@master | ||
|
||
- name: Cache R packages | ||
uses: actions/cache@v1 | ||
with: | ||
path: renv/library | ||
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('renv.lock') }} | ||
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1- | ||
|
||
- name: Make sure renv exists | ||
shell: Rscript {0} | ||
run: | | ||
if (system.file(package = "renv") == "") install.packages("renv") | ||
- name: Verify R version matches | ||
shell: Rscript {0} | ||
run: | | ||
renv::restore(packages = "jsonlite") | ||
# Assert that R versions match | ||
stopifnot( | ||
compareVersion( | ||
paste0(R.version$major, ".", R.version$minor), | ||
jsonlite::read_json("renv.lock")$R$Version | ||
) == 0 | ||
) | ||
- name: Install system dependencies | ||
if: runner.os == 'Linux' | ||
# do not record `pak` activity | ||
shell: Rscript {0} | ||
run: | | ||
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") | ||
lapply(names(jsonlite::read_json("renv.lock")$Packages), function(pkg) { | ||
pak::pkg_system_requirements(pkg, execute = TRUE) | ||
}) | ||
remove.packages("pak") | ||
- name: Restore renv packages | ||
shell: Rscript {0} | ||
run: | | ||
renv::restore() | ||
- name: Sync manifest.json | ||
shell: Rscript {0} | ||
run: | | ||
if (system.file(package = "rsconnect") == "") install.packages("rsconnect") | ||
# Connect does not like `renv`'s `./.Rprofile` | ||
# Removing file as Connect listens to the `./manifest.json` files | ||
unlink(".Rprofile") | ||
rsconnect::writeManifest(appDir = "./") | ||
- name: Git Config | ||
run: | | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
git add manifest.json && git commit -m 'manifest.json (GitHub Actions)' || echo "No manifest.json changes to commit" | ||
- name: Git Push | ||
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 |
---|---|---|
|
@@ -2,5 +2,4 @@ | |
.Rhistory | ||
.RData | ||
.Ruserdata | ||
.Rprofile* | ||
.Renviron* |
Oops, something went wrong.