From 6310077f0947ddc1953c87fed5f60d71221a2220 Mon Sep 17 00:00:00 2001 From: florisvdh Date: Tue, 14 Nov 2023 10:09:47 +0100 Subject: [PATCH 1/2] GHA R-CMD-check-latest: modernize to make use of pak --- .github/workflows/R-CMD-check-latest.yaml | 62 +++++------------------ 1 file changed, 14 insertions(+), 48 deletions(-) diff --git a/.github/workflows/R-CMD-check-latest.yaml b/.github/workflows/R-CMD-check-latest.yaml index f40a86b..081d080 100644 --- a/.github/workflows/R-CMD-check-latest.yaml +++ b/.github/workflows/R-CMD-check-latest.yaml @@ -23,8 +23,8 @@ jobs: fail-fast: false matrix: config: - # - {os: ubuntu-22.04, r: 'release'} - # - {os: ubuntu-22.04, r: 'devel'} + - {os: ubuntu-22.04, r: 'release'} + - {os: ubuntu-22.04, r: 'devel'} - {os: windows-latest, r: 'release'} - {os: macOS-latest, r: 'release'} @@ -43,53 +43,19 @@ jobs: http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: false - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Restore (or define new) R package cache - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ matrix.config.os }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - - - name: Install system dependencies (Linux) + - name: Add ubuntugis-unstable PPA (Linux) if: runner.os == 'Linux' run: | - sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable - sudo apt-get update - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'release <- system("lsb_release -rs", intern = TRUE); writeLines(remotes::system_requirements("ubuntu", release))') - - - name: Install system dependencies (macOS) - if: runner.os == 'macOS' - run: | - brew install udunits - brew install gdal - brew install proj + # Add ubuntugis-unstable PPA + sudo mkdir -p /root/.gnupg + sudo chmod 700 /root/.gnupg + sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/ubuntugis-unstable-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 6B827C12C2D425E227EDCA75089EBE08314DF160 + sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/ubuntugis-unstable-archive-keyring.gpg] http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu `lsb_release -c -s` main" > /etc/apt/sources.list.d/ubuntugis-unstable.list' - - name: Install package dependencies - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("rcmdcheck") - shell: Rscript {0} - - - name: Check - env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false - run: | - options(rmarkdown.html_vignette.check_title = FALSE) - 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@v3 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results - path: check + cache-version: ${{ secrets.CACHE_VERSION }} + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 From ae724038402c89c03d19e9f0dc986bebb117cbe9 Mon Sep 17 00:00:00 2001 From: florisvdh Date: Wed, 27 Nov 2024 12:26:03 +0100 Subject: [PATCH 2/2] GHA workflows: use updated actions --- .github/workflows/R-CMD-check-latest.yaml | 2 +- .github/workflows/R-CMD-check.yaml | 2 +- .github/workflows/site-deploy.yaml | 2 +- .github/workflows/site-devel.yaml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/R-CMD-check-latest.yaml b/.github/workflows/R-CMD-check-latest.yaml index 081d080..a82869f 100644 --- a/.github/workflows/R-CMD-check-latest.yaml +++ b/.github/workflows/R-CMD-check-latest.yaml @@ -33,7 +33,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index e2f576b..a93f1ee 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -27,7 +27,7 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 diff --git a/.github/workflows/site-deploy.yaml b/.github/workflows/site-deploy.yaml index 8a749c9..dec385c 100644 --- a/.github/workflows/site-deploy.yaml +++ b/.github/workflows/site-deploy.yaml @@ -12,7 +12,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 diff --git a/.github/workflows/site-devel.yaml b/.github/workflows/site-devel.yaml index 8df634a..5df9a8e 100644 --- a/.github/workflows/site-devel.yaml +++ b/.github/workflows/site-devel.yaml @@ -12,7 +12,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -31,7 +31,7 @@ jobs: Rscript -e 'options(rmarkdown.html_vignette.check_title = FALSE); pkgdown::build_site()' - name: Upload pkgdown-site as artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: pkgdown-site path: docs