-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 changed file
with
39 additions
and
5 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 |
---|---|---|
|
@@ -26,16 +26,50 @@ jobs: | |
use-public-rspm: true | ||
r-version: 'release' | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
- 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: Cache R packages | ||
uses: actions/cache@v2 | ||
with: | ||
extra-packages: any::pkgdown, local::. | ||
extra-repositories: https://mokymai.github.io/download/ | ||
needs: website | ||
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 dependencies | ||
run: | | ||
remotes::install_cran(c("rmarkdown", "devtools", "pkgdown", "ps")) | ||
remotes::install_deps(dependencies = TRUE) | ||
shell: Rscript {0} | ||
|
||
- name: Configure Git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
- name: Roxygenize | ||
# The vignettes will be built in step "Deploy package" | ||
run: | | ||
devtools::document(roclets = c('rd', 'collate', 'namespace')) | ||
shell: Rscript {0} | ||
|
||
- name: Commit documentation updates | ||
run: | | ||
git add --all | ||
git commit -m 'Re-build documentation' || echo "No changes to commit" | ||
git push origin || echo "No changes to commit (documentation)" | ||
- name: Install package | ||
run: R CMD INSTALL . | ||
|
||
- name: Render README | ||
run: Rscript -e 'rmarkdown::render("README.Rmd")' | ||
|
||
- name: Commit (if README was changed) | ||
- name: Commit README (if README was changed) | ||
run: | | ||
git commit README.md -m 'Re-build README.Rmd before pkgdown' || echo "No changes to commit (README)" | ||
git push origin || echo "No changes to commit (README)" | ||
|