From 8ff958afe63498a5c691945a36edf7ab7bcb98db Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Tue, 9 Jul 2024 15:11:09 -0400 Subject: [PATCH] Update GHA workflows to latest from r-lib/actions (#337) * Update R-CMD-check workflow * Try modernizing pkgdown too --- .github/workflows/R-CMD-check.yaml | 29 ++++++++++---------- .github/workflows/pkgdown.yaml | 44 ++++++++---------------------- 2 files changed, 26 insertions(+), 47 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 77faca4e..989348d5 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,13 +1,14 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples on: push: - branches: - - master + branches: [main, master] pull_request: - branches: - - master + branches: [main, master] name: R-CMD-check +permissions: read-all + jobs: R-CMD-check: runs-on: ${{ matrix.config.os }} @@ -18,22 +19,21 @@ jobs: fail-fast: false matrix: config: - - {os: macos-11, r: '4.1'} - - {os: macos-11, r: '4.2'} - - {os: windows-latest, r: '4.1'} - - {os: windows-latest, r: '4.2'} - - {os: ubuntu-latest, r: '3.6'} - - {os: ubuntu-latest, r: '4.0'} - - {os: ubuntu-latest, r: '4.1'} - - {os: ubuntu-latest, r: '4.2'} + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + - {os: ubuntu-latest, r: 'oldrel-2'} + - {os: ubuntu-latest, r: 'oldrel-3'} + - {os: ubuntu-latest, r: 'oldrel-4'} env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true GITHUB_PAT: ${{ secrets.GHA_PAT }} R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -51,3 +51,4 @@ jobs: - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 9e15347a..736872b8 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -13,44 +13,22 @@ name: pkgdown jobs: pkgdown: if: ${{ github.event_name == 'push' || startsWith(github.head_ref, 'pkgdown/') }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: - RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + GITHUB_PAT: ${{ secrets.GHA_PAT }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: r-lib/actions/setup-r@v1 - id: install-r + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-pandoc@v1 - - - name: Install pak and query dependencies - run: | - install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") - saveRDS(pak::pkg_deps(".", dependencies = TRUE), ".github/r-depends.rds") - shell: Rscript {0} - - - name: Cache R packages - uses: actions/cache@v2 + - uses: r-lib/actions/setup-r@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} - restore-keys: ${{ runner.os }}-${{ steps.install-r.outputs.installed-r-version }}-1- - - - name: Install system dependencies - if: runner.os == 'Linux' - run: | - pak::local_system_requirements(execute = TRUE) - pak::pkg_system_requirements("pkgdown", execute = TRUE) - shell: Rscript {0} + use-public-rspm: true - - name: Install package and dependencies - run: | - pak::local_install_dev_deps(upgrade = TRUE) - pak::pkg_install("r-lib/pkgdown") - pak::pkg_install("rstudio/quillt") - shell: Rscript {0} + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website - name: Install package run: R CMD INSTALL . @@ -75,7 +53,7 @@ jobs: with: publish-dir: 'docs' production-branch: master - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.GHA_PAT }} deploy-message: 'Deploy from GHA: ${{ github.event.head_commit.message }} (${{ github.sha }})' enable-pull-request-comment: false