Skip to content

* .github/workflows/R-CMD-check.yaml: simplify. #447

* .github/workflows/R-CMD-check.yaml: simplify.

* .github/workflows/R-CMD-check.yaml: simplify. #447

Workflow file for this run

# 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-ignore: [gh-pages]
pull_request:
branches-ignore: [gh-pages]
name: R-CMD-check
concurrency:
group: ${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
_R_CHECK_FORCE_SUGGESTS_: false
_R_CHECK_CRAN_INCOMING_REMOTE_: false
LATEX_PACKAGES: "oberdiek grfext environ trimspaces etoolbox upquote babel-english pgf xcolor algorithms relsize tocbibind appendix tocloft enumitem listings tcolorbox collection-fontsrecommended framed inconsolata microtype"
R_KEEP_PKG_SOURCE: yes
jobs:
R-CMD-check:
if: "! contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ${{ matrix.config.os }}
name: Check ${{ matrix.config.os }} (${{ matrix.config.r }})
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-20.04, r: '3.6'}
# Use latest ubuntu to make it easier to install dependencies
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
- name: Install MPI in macOS
run: brew install openmpi
if: runner.os == 'macOS'
- name: Install openmpi on Linux
if: runner.os == 'Linux'
run: sudo apt-get update -y && sudo apt install -y libopenmpi-dev
# special branch required for TeX Live 2023 fix
- uses: r-lib/actions/setup-tinytex@v2-branch
- run: tlmgr --version
- name: Install additional LaTeX packages
run: tlmgr install ${{ env.LATEX_PACKAGES }}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, mlr=?ignore-before-r=4.0.0
needs: check
cache-version: 1
- name: Check (as CRAN)
env:
NOT_CRAN: false
uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual", "--as-cran")'
build_args: 'c("--compact-vignettes=gs+qpdf")'
- name: Check
env:
NOT_CRAN: true
uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual", "--run-donttest", "--timings")'
- name: Show testthat output
if: failure()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
coverage:
needs: R-CMD-check
name: Coverage
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 30
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-tinytex@v2-branch
- name: Install additional LaTeX packages
run: tlmgr install ${{ env.LATEX_PACKAGES }}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, mlr=?ignore
needs: coverage
- name: Test coverage
env:
NOT_CRAN: true
COVR_COVERAGE: true
run: |
options(covr.fix_parallel_mcexit = TRUE)
coverage <- covr::package_coverage(type = "all",
quiet = FALSE, clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package"))
print(coverage)
covr::codecov(coverage = coverage)
shell: Rscript {0}
- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
- name: Show failures
if: failure()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -type d | xargs -I 'X' find 'X' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
- name: Upload test results
if: failure()
uses: actions/upload-artifact@main
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
pkgdown:
needs: R-CMD-check
if: contains('
refs/heads/master
refs/heads/main
', github.ref) && github.event_name == 'push'
name: pkgdown
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
use-public-rspm: true
- uses: r-lib/actions/setup-tinytex@v2-branch
- name: Install additional LaTeX packages
run: tlmgr install ${{ env.LATEX_PACKAGES }}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, mlr=?ignore
needs: website
- name: Install package with vignettes
if: success()
run: |
remotes::install_local(".", build = TRUE, upgrade = "never", force = TRUE, build_opts = c("--no-resave-data"), build_manual = TRUE, build_vignettes = TRUE)
shell: Rscript {0}
- name: Deploy package
if: success()
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
# Commit version.R so that install_github works
# FIXME: Is there a better way to record the git sha in R?
#git add --force R/version.R
#git commit R/version.R --m "Update version.R [skip ci]"
# pull so that if there are new commits, we can push
#git pull --rebase
# git push origin 'HEAD:master' || exit 1
# pkgdown
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' || exit 1
# Commit vignette PDF to webpage
export DEST_DIR=$(mktemp -d)
git remote set-branches origin gh-pages
git fetch origin gh-pages
git worktree add --track -B gh-pages $DEST_DIR origin/gh-pages
pushd $DEST_DIR
Rscript -e 'file.copy(system.file("doc/irace-package.pdf",package="irace", mustWork=TRUE), "./", overwrite=TRUE)' || exit 1
git add -A .
git commit --allow-empty -m "Regenerate user guide [skip ci]"
git push origin 'HEAD:gh-pages'
popd
git worktree remove $DEST_DIR
shell: bash {0}