Skip to content

Documentation

Documentation #130

# 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:
schedule:
- cron: 0 0 * * 1 # schedule to run at midnight on Monday each week
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
name: Documentation
jobs:
docs:
runs-on: ${{ matrix.config.os }}
name: docs
strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-20.04, r: 'release', pkgs: 'all'}
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: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}
- 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') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- name: Install system dependencies
run: |
sudo apt-get -y install \
libcurl4-openssl-dev coinor-libsymphony-dev coinor-libcbc-dev coinor-libclp-dev \
libudunits2-dev libgdal-dev libgeos-dev libproj-dev libglpk-dev
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")
remotes::install_cran("covr")
remotes::install_bioc("lpsymphony")
remotes::install_cran("urlchecker")
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: Set environmental variables for package checks
if: matrix.config.pkgs == 'depends only'
run: |
echo "_R_CHECK_DEPENDS_ONLY_=true" >> $GITHUB_ENV
- name: Check URLs
if: runner.os == 'Linux' && matrix.config.r == 'release'
run: |
d <- suppressWarnings(readLines("inst/URLLIST"))
result <- urlchecker::url_check()
result <- result[!result$URL %in% d, , drop = FALSE]
if (nrow(result) > 0) {
print(result)
stop("Invalid URLs detected")
}
shell: Rscript {0}