|
- # NOTE: This workflow is overkill for most R packages
- # check-standard.yaml is likely a better choice
- # usethis::use_github_action("check-standard") will install it.
- #
- # 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:
- - main
- pull_request:
- branches:
- - main
-
- name: R-CMD-check
-
- jobs:
- R-CMD-check:
- runs-on: ${{ matrix.config.os }}
-
- name: ${{ matrix.config.os }} (${{ matrix.config.r }})
-
- strategy:
- fail-fast: false
- matrix:
- config:
- - {os: macOS-latest, r: 'release'}
- - {os: windows-latest, r: 'release'}
- - {os: windows-latest, r: '3.6'}
- - {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'}
- - {os: ubuntu-18.04, r: 'release'}
- - {os: ubuntu-18.04, r: 'oldrel-1'}
-
- env:
- GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
- R_KEEP_PKG_SOURCE: yes
-
- steps:
- - uses: actions/checkout@v2
-
- - uses: r-lib/actions/setup-r@v1
- id: install-r
- with:
- r-version: ${{ matrix.config.r }}
- http-user-agent: ${{ matrix.config.http-user-agent }}
- use-public-rspm: true
-
- - uses: r-lib/actions/setup-pandoc@v1
-
- - name: Install devel system dependencies
- if: matrix.config.os == 'ubuntu-18.04' && matrix.config.r == 'devel'
- run: sudo apt-get install -y libcurl4-openssl-dev
-
- - uses: r-lib/actions/setup-r-dependencies@v1
- with:
- cache-version: 1
- extra-packages: rcmdcheck
-
- - uses: r-lib/actions/check-r-package@v1
-
- - name: Show testthat output
- if: always()
- run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
- shell: bash
-
- - name: Code coverage
- if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'release'
- shell: Rscript {0}
- run: |
- pak::pkg_install("covr")
- covr::codecov()
-
- - name: Upload check results
- if: failure()
- uses: actions/upload-artifact@main
- with:
- name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
- path: check
|