GHA: modernize - take 1 #65
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
on: [push] | |
name: covr | |
jobs: | |
covr: | |
if: "! contains(github.event.head_commit.message, '[ci skip]')" | |
timeout-minutes: 45 | |
runs-on: ubuntu-latest | |
name: covr | |
strategy: | |
fail-fast: false | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_KEEP_PKG_SOURCE: yes | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
## Test in other locale (optional) | |
LANGUAGE: ${{ matrix.config.language }} | |
## R CMD check | |
_R_CHECK_CRAN_INCOMING_: false | |
_R_CHECK_LENGTH_1_CONDITION_: true | |
_R_CHECK_LENGTH_1_LOGIC2_: true | |
_R_CHECK_MATRIX_DATA_: true | |
_R_CHECK_SUGGESTS_ONLY_: true | |
_R_CHECK_THINGS_IN_TEMP_DIR_: true | |
RCMDCHECK_ERROR_ON: note | |
## Specific to futures | |
R_FUTURE_RNG_ONMISUSE: error | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: | | |
any::rcmdcheck | |
any::remotes | |
any::sessioninfo | |
any::covr | |
needs: check | |
- name: Install dependencies | |
run: | | |
remotes::install_deps(dependencies = TRUE) | |
install.packages(".", repos=NULL, type="source") | |
shell: Rscript {0} | |
- name: Session info | |
run: | | |
options(width = 100) | |
pkgs <- installed.packages()[, "Package"] | |
sessioninfo::session_info(pkgs, include_base = TRUE) | |
shell: Rscript {0} | |
- name: Test coverage | |
run: | | |
## 1. Get 'Repository Upload Token' from Codecov: | |
## https://app.codecov.io/gh/<org>/<repo>/settings | |
## 2. Set 'CODECOV_TOKEN' in GitHub Secrets: | |
## https://github.com/<org>/<repo>/settings/environments/ | |
coverage <- covr::package_coverage(quiet = FALSE) | |
print(coverage) | |
covr::codecov(coverage = coverage, token="${{secrets.CODECOV_TOKEN}}") | |
shell: Rscript {0} |