| # 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 | |||||
| # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | |||||
| # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |||||
| on: | on: | ||||
| push: | push: | ||||
| branches: | |||||
| - main | |||||
| branches: [main, master] | |||||
| pull_request: | pull_request: | ||||
| branches: | |||||
| - main | |||||
| branches: [main, master] | |||||
| name: R-CMD-check | name: R-CMD-check | ||||
| config: | config: | ||||
| - {os: macOS-latest, r: 'release'} | - {os: macOS-latest, r: 'release'} | ||||
| - {os: windows-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'} | |||||
| - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} | |||||
| - {os: ubuntu-latest, r: 'release'} | |||||
| - {os: ubuntu-latest, r: 'oldrel-1'} | |||||
| env: | env: | ||||
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||||
| steps: | steps: | ||||
| - uses: actions/checkout@v2 | - uses: actions/checkout@v2 | ||||
| - uses: r-lib/actions/setup-r@v1 | |||||
| id: install-r | |||||
| - uses: r-lib/actions/setup-pandoc@v2 | |||||
| - uses: r-lib/actions/setup-r@v2 | |||||
| with: | with: | ||||
| r-version: ${{ matrix.config.r }} | r-version: ${{ matrix.config.r }} | ||||
| http-user-agent: ${{ matrix.config.http-user-agent }} | http-user-agent: ${{ matrix.config.http-user-agent }} | ||||
| use-public-rspm: true | 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 | |||||
| - uses: r-lib/actions/setup-r-dependencies@v2 | |||||
| with: | 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() | |||||
| extra-packages: any::rcmdcheck | |||||
| needs: check | |||||
| - name: Upload check results | |||||
| if: failure() | |||||
| uses: actions/upload-artifact@main | |||||
| - uses: r-lib/actions/check-r-package@v2 | |||||
| with: | with: | ||||
| name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results | |||||
| path: check | |||||
| upload-snapshots: true |