Fixing github actions #35
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
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. | |
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions | |
on: | |
push: | |
branches: | |
- github_actions | |
- master | |
pull_request: | |
branches: | |
- github_actions | |
- master | |
name: macOS | |
jobs: | |
R-CMD-check: | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.os }} (${{ matrix.config.r }}, Java ${{ matrix.config.java }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: macOS-latest, r: 'release', java: 8} | |
- {os: macOS-latest, r: 'release', java: 11} | |
env: | |
_R_REMOTES_NO_ERRORS_FROM_WARNINGS_: true | |
_R_CHECK_FORCE_SUGGESTS_: false | |
_R_CHECK_TIMINGS_: 10 | |
_R_CHECK_CRAN_INCOMING_REMOTE_: false | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
CI: true | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: ${{ matrix.config.java }} | |
- uses: r-lib/actions/setup-r@v1 | |
with: | |
r-version: ${{ matrix.config.r }} | |
- name: Setup R Java support | |
run: | | |
echo export PATH=$PATH > reconf.sh | |
echo export JAVA_HOME=$JAVA_HOME >> reconf.sh | |
echo R CMD javareconf >> reconf.sh | |
sudo bash reconf.sh | |
shell: bash | |
- uses: r-lib/actions/setup-tinytex@v2 | |
- uses: r-lib/actions/setup-pandoc@v1 | |
- 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 | |
if: runner.os != 'Windows' | |
uses: actions/cache@v2 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-${{ hashFiles('.github/depends.Rds') }} | |
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}- | |
- name: Install system dependencies | |
run: | | |
brew install pkg-config | |
brew install proj | |
brew install geos | |
brew install gdal | |
sudo R CMD javareconf | |
- name: Install dependencies | |
run: | | |
options("install.packages.compile.from.source" = "never") | |
remotes::install_deps(dependencies = TRUE) | |
remotes::install_cran("rcmdcheck") | |
remotes::install_cran("covr") | |
remotes::install_bioc("lpsymphony") | |
remotes::install_cran("RandomFieldsUtils", force = TRUE) | |
remotes::install_cran("RandomFields", type = "source", force = TRUE) | |
shell: Rscript {0} | |
- name: Session information | |
run: | | |
options(width = 100) | |
pkgs <- installed.packages()[, "Package"] | |
sessioninfo::session_info(pkgs, include_base = TRUE) | |
shell: Rscript {0} | |
- name: Java information | |
run: java -version && which java && echo $PATH && echo $JAVA_HOME | |
shell: bash | |
- name: Check | |
run: | | |
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--ignore-vignettes", "--no-build-vignettes", "--compact-vignettes=no", "--no-multiarch"), error_on = "error", 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() | |
uses: actions/upload-artifact@main | |
with: | |
name: ${{ runner.os }}-r${{ matrix.config.r }}-results | |
path: check |