actions@v5 #373
This file contains hidden or 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
| # 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 | |
| - master | |
| paths-ignore: | |
| - "Meta**" | |
| - "memcheck**" | |
| - "docs**" | |
| - "**.git" | |
| - "**.json" | |
| - "**.md" | |
| - "**.R[dD]ata" | |
| - "**.Rpro*" | |
| - "**.yml" | |
| - "!**R-CMD-check.yml" | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| paths-ignore: | |
| - "Meta**" | |
| - "memcheck**" | |
| - "docs**" | |
| - "**.git" | |
| - "**.json" | |
| - "**.md" | |
| - "**.R[dD]ata" | |
| - "**.Rpro*" | |
| - "**.yml" | |
| - "!**R-CMD-check.yml" | |
| 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: windows-latest, r: 'release'} | |
| - {os: macOS-latest, r: 'release'} | |
| - {os: ubuntu-22.04, r: '4.0', rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"} | |
| - {os: ubuntu-24.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/noble/latest"} | |
| - {os: ubuntu-24.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/noble/latest"} | |
| env: | |
| _R_CHECK_CRAN_INCOMING_: true # Seemingly not set by --as-cran | |
| _R_CHECK_FORCE_SUGGESTS_: false # CRAN settings | |
| R_COMPILE_AND_INSTALL_PACKAGES: 'never' | |
| _R_CHECK_THINGS_IN_CHECK_DIR_: false | |
| R_REMOTES_STANDALONE: true | |
| R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
| RSPM: ${{ matrix.config.rspm }} | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: 'true' | |
| - name: Temporarily bump package version | |
| run: | | |
| old_version=$(grep "Version:" DESCRIPTION | awk '{print $2}') | |
| if [[ $(echo "$old_version" | tr -cd '.' | wc -c) -eq 2 ]]; then | |
| new_version="${old_version}.9999" | |
| if [[ "$RUNNER_OS" == "macOS" ]]; then | |
| sed -i "" "s/Version: .*/Version: ${new_version}/" DESCRIPTION | |
| else | |
| sed -i "s/Version: .*/Version: ${new_version}/" DESCRIPTION | |
| fi | |
| fi | |
| echo "Current package version is now: $(grep "Version:" DESCRIPTION | awk '{print $2}')" | |
| shell: bash | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: ${{ matrix.config.r }} | |
| - name: Install apt packages | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get install texlive-latex-base \ | |
| texlive-fonts-recommended | |
| - name: Set up R dependencies (Windows) | |
| if: runner.os == 'Windows' | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| needs: | | |
| check | |
| coverage | |
| - name: Set up R dependencies (R 4.0) | |
| if: matrix.config.r == '4.0' | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: # Inherited from R3.6 | |
| extra-packages: | | |
| rvest@1.0.4 | |
| svglite@2.1.3 | |
| bench@1.1.3 | |
| cpp11@0.5.0 | |
| downlit@0.4.3 | |
| evaluate@0.23 | |
| gh@1.4.1 | |
| gtable@0.3.5 | |
| httr2@1.0.1 | |
| magick@2.8.5 | |
| knitr@1.45 | |
| pkgdown@2.0.9 | |
| profvis@0.3.8 | |
| purrr@1.0.2 | |
| rjson@0.2.20 | |
| scales@1.3.0 | |
| testthat@3.2.1 | |
| usethis@3.1.0 | |
| vdiffr@1.0.7 | |
| waldo@0.5.3 | |
| XML@3.99-0.3 | |
| needs: | | |
| check | |
| - name: Set up R dependencies (Non-Windows) | |
| if: runner.os != 'Windows' && matrix.config.r != '4.0' | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| needs: | | |
| check | |
| - name: Check package | |
| uses: r-lib/actions/check-r-package@v2 | |
| - name: Code coverage | |
| if: runner.os == 'Windows' | |
| run: | | |
| covr::codecov() | |
| shell: Rscript {0} | |
| - name: Notify on failure | |
| if: failure() && github.event_name == 'schedule' | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: 93, | |
| body: 'Scheduled workflow has failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
| }); |