-
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.
Showing
3 changed files
with
40 additions
and
44 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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
|
||
# Trigger the workflow... | ||
on: | ||
# ...on push or pull request | ||
|
@@ -19,65 +22,52 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
config: | ||
- {os: windows-latest, r: 'oldrel'} | ||
- {os: windows-latest, r: 'oldrel-1'} | ||
- {os: windows-latest, r: 'release'} | ||
- {os: windows-latest, r: 'devel'} | ||
- {os: macOS-latest, r: 'oldrel'} | ||
- {os: macOS-latest, r: 'release'} | ||
- {os: macOS-latest, r: 'devel'} | ||
- {os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} | ||
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} | ||
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} | ||
- {os: macOS-latest, r: 'oldrel-1'} | ||
- {os: macOS-latest, r: 'release'} | ||
- {os: macOS-latest, r: 'devel'} | ||
- {os: ubuntu-latest, r: 'oldrel-1'} | ||
- {os: ubuntu-latest, r: 'release'} | ||
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} | ||
|
||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
RSPM: ${{ matrix.config.rspm }} | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
R_KEEP_PKG_SOURCE: yes | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: r-lib/actions/setup-pandoc@v1 | ||
|
||
- uses: r-lib/actions/setup-r@v1 | ||
# this gets often stuck (esp. on macOS) for the default 6h timeout | ||
timeout-minutes: 5 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
http-user-agent: ${{ matrix.config.http-user-agent }} | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-pandoc@v1 | ||
|
||
- name: Query dependencies | ||
- name: Ensure symlinks to the installed R and Rscript on macOS | ||
# work around https://github.com/r-lib/actions/issues/412 | ||
if: runner.os == 'macOS' | ||
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} | ||
sudo ln -sf $R_HOME/bin/R /usr/local/bin | ||
sudo ln -sf $R_HOME/bin/Rscript /usr/local/bin | ||
env: | ||
R_HOME: /Library/Frameworks/R.framework/Resources | ||
|
||
- name: Restore R package cache | ||
uses: actions/cache@v2 | ||
- uses: r-lib/actions/setup-r-dependencies@v1 | ||
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- | ||
extra-packages: rcmdcheck | ||
|
||
- 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("rcmdcheck") | ||
shell: Rscript {0} | ||
- uses: r-lib/actions/check-r-package@v1 | ||
|
||
- name: Check | ||
env: | ||
_R_CHECK_CRAN_INCOMING_REMOTE_: false | ||
run: | | ||
options(crayon.enabled = TRUE) | ||
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") | ||
shell: Rscript {0} | ||
- name: Show testthat output | ||
if: always() | ||
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true | ||
shell: bash | ||
|
||
- name: Upload check results | ||
if: failure() | ||
|
@@ -89,15 +79,15 @@ jobs: | |
- name: Test coverage | ||
if: success() && runner.os == 'Linux' && matrix.config.r == 'release' | ||
run: | | ||
remotes::install_cran("covr") | ||
pak::pkg_install("covr") | ||
covr::codecov() | ||
shell: Rscript {0} | ||
|
||
- name: Build and deploy pkgdown website | ||
if: success() && github.ref == 'refs/heads/main' && runner.os == 'Linux' && matrix.config.r == 'release' | ||
run: | | ||
R CMD INSTALL . | ||
Rscript -e 'install.packages("pkgdown")' | ||
Rscript -e 'pak::pkg_install("pkgdown")' | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Actions" | ||
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
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