From 0108ec393e6eaed3190c36e89ab7ad8c3ee39bbd Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Fri, 22 Apr 2022 21:00:13 +0200 Subject: [PATCH 1/4] allow manual deploy of pkgdown website --- .github/workflows/pkgdown.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 9e15347a..ec29d1e0 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -7,6 +7,7 @@ on: branches: - main - master + workflow_dispatch: name: pkgdown From 90bebcf47554e1fe9418ee81f31372b8d09d5d6d Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Fri, 22 Apr 2022 23:29:47 +0200 Subject: [PATCH 2/4] update the pkgdown workflow also --- .github/workflows/pkgdown.yaml | 64 +++++++++------------------------- DESCRIPTION | 1 + 2 files changed, 17 insertions(+), 48 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index ec29d1e0..fc65a94f 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -1,12 +1,10 @@ on: push: - branches: - - main - - master + branches: [main, master] pull_request: - branches: - - main - - master + branches: [main, master] + release: + types: [published] workflow_dispatch: name: pkgdown @@ -14,61 +12,31 @@ name: pkgdown jobs: pkgdown: if: ${{ github.event_name == 'push' || startsWith(github.head_ref, 'pkgdown/') }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: - RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - 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-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- + use-public-rspm: true - - 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} - - - 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} - - - name: Install package - run: R CMD INSTALL . + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + - name: Build pkgdown site run: pkgdown::build_site(new_process = FALSE) shell: Rscript {0} - - name: Git setup - run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" - - - name: Deploy package - run: pkgdown::deploy_to_branch(new_process = FALSE) - shell: Rscript {0} - - name: Deploy to Netlify id: netlify-deploy uses: nwtgck/actions-netlify@v1.1 diff --git a/DESCRIPTION b/DESCRIPTION index e96e3d2f..7474cf6b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -56,3 +56,4 @@ Config/testthat/edition: 3 Roxygen: list(markdown = TRUE) VignetteBuilder: knitr Language: en-US +Config/Needs/website: rstudio/quillt, pkgdown From 178bccb42decfe034c3eee736d3eff6e43973b0e Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Fri, 22 Apr 2022 23:34:45 +0200 Subject: [PATCH 3/4] Update R-CMD-CHECK workflow also --- .github/workflows/R-CMD-check.yaml | 60 ++++++++---------------------- 1 file changed, 15 insertions(+), 45 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 652d2934..7171d9fa 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -22,65 +22,35 @@ jobs: - {os: macOS-latest, r: '4.0'} - {os: windows-latest, r: '3.6'} - {os: windows-latest, r: '4.0'} - - {os: ubuntu-16.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - - {os: ubuntu-16.04, r: '4.0', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: ubuntu-latest, r: '3.6'} + - {os: ubuntu-latest, r: '4.0'} env: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: ${{ matrix.config.rspm }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} + use-public-rspm: true - - uses: r-lib/actions/setup-pandoc@master - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - shell: Rscript {0} - - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v1 + - uses: r-lib/actions/setup-pandoc@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-r-${{ matrix.config.r }}-2-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-2- + pandoc-version: ${{ matrix.config.pandoc }} - - name: Install system dependencies - if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc - run: | - Rscript -e "remotes::install_github('r-hub/sysreqs')" - sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") - sudo -s eval "$sysreqs" - - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("rcmdcheck") - shell: Rscript {0} - - - name: Check - env: - _R_CHECK_CRAN_INCOMING_: false - run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@master + - uses: r-lib/actions/setup-r-dependencies@v2 with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 - name: Test coverage if: matrix.config.os == 'macOS-latest' && matrix.config.r == '4.0' - run: covr::codecov() + run: | + pak::pkg_install('covr') + covr::codecov() shell: Rscript {0} From a49bc47c135b96bb95579d0afdf58fce82d64fe6 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Fri, 22 Apr 2022 23:37:46 +0200 Subject: [PATCH 4/4] there is no different pandoc version to install --- .github/workflows/R-CMD-check.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 7171d9fa..47f18d8b 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -38,8 +38,6 @@ jobs: use-public-rspm: true - uses: r-lib/actions/setup-pandoc@v2 - with: - pandoc-version: ${{ matrix.config.pandoc }} - uses: r-lib/actions/setup-r-dependencies@v2 with: