validate #2950
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: | |
branches: | |
- main | |
- master | |
- "r-*" | |
pull_request: | |
branches: | |
- main | |
- master | |
- "r-*" | |
schedule: | |
- cron: '20 2 * * *' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }} | |
cancel-in-progress: true | |
name: validate | |
jobs: | |
db-tests: | |
runs-on: ${{ matrix.config.os }}${{ matrix.config.os-version }} | |
name: ${{ matrix.config.os }}${{ matrix.config.os-version }} (${{ matrix.config.r }}) ${{ matrix.config.desc }} | |
# Begin custom: services | |
# End custom: services | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { os: ubuntu-, os-version: 22.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest" } | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
RSPM: ${{ matrix.config.rspm }} | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
# prevent rgl issues because no X11 display is available | |
RGL_USE_NULL: true | |
# Begin custom: env vars | |
# End custom: env vars | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/workflows/custom/before-install | |
if: hashFiles('.github/workflows/custom/before-install/action.yml') != '' | |
- uses: ./.github/workflows/install | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
install-r: false | |
cache-version: rcc-smoke-1 | |
needs: check | |
extra-packages: any::rcmdcheck any::roxygen2 r-lib/styler | |
- uses: ./.github/workflows/custom/after-install | |
if: hashFiles('.github/workflows/custom/after-install/action.yml') != '' | |
- name: Instrument R code for validation | |
run: | | |
if [ $(git status --porcelain | wc -l) -gt 0 ]; then | |
echo "Fatal: git working copy not clean" | |
fi | |
sed -i -r '/INSTRUMENT: validate/ s/^( +)# /\1/g' R/* | |
if [ $(git status --porcelain | wc -l) -eq 0 ]; then | |
echo "Fatal: substitution did not change anything" | |
fi | |
- name: Run tests | |
run: | | |
testthat::test_local(reporter = testthat::ProgressReporter$new(max_failures = Inf, update_interval = Inf)) | |
shell: Rscript {0} | |
- name: Show test output | |
if: always() | |
run: | | |
find check -name '*.Rout*' -exec head -n 1000000 '{}' \; || true | |
shell: bash | |
- name: Test coverage | |
run: covr::codecov() | |
shell: Rscript {0} |