Ubuntu #121
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: | |
schedule: | |
- cron: 0 0 * * 1 # schedule to run at midnight on Monday each week | |
push: | |
branches: | |
- main | |
- master | |
pull_request: | |
branches: | |
- main | |
- master | |
name: Ubuntu | |
jobs: | |
R-CMD-check: | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) (${{ matrix.config.pkgs }} packages) | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: ubuntu-20.04, r: 'release', pkgs: 'all'} | |
# - {os: ubuntu-20.04, r: 'devel', pkgs: 'all'} | |
# - {os: ubuntu-20.04, r: 'devel', pkgs: 'depends only'} | |
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-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r }} | |
use-public-rspm: true | |
- name: Install system dependencies | |
run: | | |
sudo apt-get install libxml2 coinor-libsymphony-dev | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
cache-version: 4 | |
extra-packages: | | |
cran/XML | |
any::remotes | |
any::covr | |
any::rcmdcheck | |
gurobi=?ignore | |
Rsymphony=?ignore | |
lpsymphony=?ignore | |
ggtree=?ignore | |
- name: Install additional packages | |
run: | | |
options(repos = "https://cloud.r-project.org/") | |
remotes::install_cran("Rsymphony") | |
remotes::install_bioc("lpsymphony") | |
remotes::install_bioc("ggtree") | |
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 | |
- uses: r-lib/actions/check-r-package@v2 | |
with: | |
upload-snapshots: true | |
- name: Show testthat output | |
if: always() | |
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true | |
shell: bash | |
- name: Test coverage | |
if: runner.os == 'Linux' && matrix.config.r == 'release' | |
run: | | |
cov <- covr::package_coverage( | |
quiet = FALSE, | |
clean = FALSE, | |
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") | |
) | |
covr::to_cobertura(cov) | |
shell: Rscript {0} | |
- uses: codecov/codecov-action@v4 | |
if: runner.os == 'Linux' && matrix.config.r == 'release' | |
with: | |
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} | |
file: ./cobertura.xml | |
plugin: noop | |
disable_search: true | |
token: ${{ secrets.CODECOV_TOKEN }} |