From 6f0c3fc0869c800371840afd39cf77b3360bafc8 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 3 Jan 2023 13:41:33 -0500 Subject: [PATCH 01/15] trim GHA workflow; Test on more platforms --- .github/workflows/R-CMD-check.yaml | 77 ++++++++++-------------------- 1 file changed, 26 insertions(+), 51 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index ac89eadf42..0272b05df3 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -28,16 +28,17 @@ jobs: config: - {os: macOS-latest, r: 'release', visual_tests: true, node: "14.x", shinytest: true} - {os: windows-latest, r: 'release'} - #- {os: windows-latest, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/latest"} - - {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.1.0 (ubuntu-18.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" } + - {os: windows-latest, r: '4.1'} + - {os: windows-latest, r: '3.6'} + - {os: ubuntu-18.04, r: 'devel'} # vdiffr & shinytest only runs on linux r-release since the results aren't cross-platform - - {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - - {os: ubuntu-18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - - {os: ubuntu-18.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - - {os: ubuntu-18.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} + - {os: ubuntu-18.04, r: 'release'} + - {os: ubuntu-18.04, r: 'oldrel-1'} + - {os: ubuntu-18.04, r: 'oldrel-2'} + - {os: ubuntu-18.04, r: 'oldrel-3'} + - {os: ubuntu-18.04, r: 'oldrel-4'} env: - RSPM: ${{ matrix.config.rspm }} VISUAL_TESTS: ${{ matrix.config.visual_tests }} SHINYTEST: ${{ matrix.config.shinytest }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -48,43 +49,23 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 id: install-r with: r-version: ${{ matrix.config.r }} - http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true - - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-pandoc@v2 - - name: Install pak and query dependencies - run: | - install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") - saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds") - shell: Rscript {0} - - - name: Restore R package cache - uses: actions/cache@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - path: | - ${{ env.R_LIBS_USER }}/* - !${{ env.R_LIBS_USER }}/pak - key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} - restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1- + cache-version: 2 + needs: check + extra-packages: | + rcmdcheck + devtools + reshape2 - - name: Install Linux sysdeps - if: runner.os == 'Linux' - run: | - pak::local_system_requirements(execute = TRUE) - pak::pkg_system_requirements("rcmdcheck", execute = TRUE) - shell: Rscript {0} - - - name: Install dependencies - run: | - if (Sys.info()[['sysname']] == 'Darwin') options(pkgType = 'mac.binary') - pak::local_install_dev_deps(upgrade = FALSE) - pak::pkg_install("rcmdcheck") - shell: Rscript {0} - - name: Set up Python 3.8 uses: actions/setup-python@v2 with: @@ -110,8 +91,6 @@ jobs: - name: Run Tests run: | options(crayon.enabled = TRUE, testthat.progress.max_fails=1000) - if (!require(devtools)) pak::pak("devtools") - if (!require(reshape2)) pak::pak("reshape2") res <- devtools::test() df <- as.data.frame(res) if (sum(df$failed) > 0 || any(df$error)) stop("GHA CI tests failed") @@ -125,19 +104,15 @@ jobs: name: ${{ runner.os }}-r${{ matrix.config.r }}-results path: ./ - # Run check with --no-tests since we ran them abve - - name: Check - run: | - options(crayon.enabled = TRUE) - rcmdcheck::rcmdcheck(args = c("--no-tests", "--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - + - name: Check package + uses: r-lib/actions/check-r-package@v2 + with: + check-dir: '"check"' + # Run check with --no-tests since we ran them abve + args: 'c("--no-tests", "--no-manual", "--as-cran")' + error-on: '"warning"' + #- name: Show testthat output # if: always() # run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true # shell: bash - - - name: Don't use tar from old Rtools to store the cache - if: ${{ runner.os == 'Windows' && startsWith(steps.install-r.outputs.installed-r-version, '3.6' ) }} - shell: bash - run: echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH From f1849e02c7b7723367eea79a054aad9e541ffc89 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 3 Jan 2023 14:15:09 -0500 Subject: [PATCH 02/15] try single line --- .github/workflows/R-CMD-check.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 0272b05df3..385794b4e6 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -61,10 +61,7 @@ jobs: with: cache-version: 2 needs: check - extra-packages: | - rcmdcheck - devtools - reshape2 + extra-packages: rcmdcheck,devtools,reshape2 - name: Set up Python 3.8 uses: actions/setup-python@v2 From ed455bbd5b8efb721edf35387ac3bcfc63894cba Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 3 Jan 2023 14:20:02 -0500 Subject: [PATCH 03/15] Remove devtools --- DESCRIPTION | 1 - 1 file changed, 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 708763e0b3..2957b82072 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -56,7 +56,6 @@ Suggests: ggalluvial, testthat, knitr, - devtools, shiny (>= 1.1.0), shinytest (>= 1.3.0), curl, From d8419f707b608b916b1a2f048eaab8f3173b19bd Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 3 Jan 2023 14:24:34 -0500 Subject: [PATCH 04/15] Move check packages to config --- DESCRIPTION | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DESCRIPTION b/DESCRIPTION index 2957b82072..f2982b5555 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -81,3 +81,7 @@ LazyData: true RoxygenNote: 7.2.3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) +Config/Needs/check: + rcmdcheck, + devtools, + reshape2 From 73a44175032fe485a6423d61649d960bed47a23e Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 3 Jan 2023 14:25:02 -0500 Subject: [PATCH 05/15] Remove extra-packages that are in DESCRIPTION file --- .github/workflows/R-CMD-check.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 385794b4e6..524c7d6b6f 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -61,7 +61,6 @@ jobs: with: cache-version: 2 needs: check - extra-packages: rcmdcheck,devtools,reshape2 - name: Set up Python 3.8 uses: actions/setup-python@v2 From df558662fcf0f40bbc6c2002a2f1b3bb08b46049 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 3 Jan 2023 14:31:43 -0500 Subject: [PATCH 06/15] Remove devtools/rmdcheck from description file --- DESCRIPTION | 2 -- 1 file changed, 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f2982b5555..e23f94e9e9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -82,6 +82,4 @@ RoxygenNote: 7.2.3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) Config/Needs/check: - rcmdcheck, - devtools, reshape2 From 6aeb63140dec8dbe027361ee770651c361c2fc53 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 3 Jan 2023 14:33:05 -0500 Subject: [PATCH 07/15] Add rcmdcheck and devtools to GHA file --- .github/workflows/R-CMD-check.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 524c7d6b6f..fe96c50148 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -61,6 +61,9 @@ jobs: with: cache-version: 2 needs: check + extra-packages: + rcmdcheck, + devtools - name: Set up Python 3.8 uses: actions/setup-python@v2 From 8cda32f878baf53dc8f892e73832516fefb63e91 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 3 Jan 2023 14:39:26 -0500 Subject: [PATCH 08/15] Revert package additions --- .github/workflows/R-CMD-check.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index fe96c50148..524c7d6b6f 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -61,9 +61,6 @@ jobs: with: cache-version: 2 needs: check - extra-packages: - rcmdcheck, - devtools - name: Set up Python 3.8 uses: actions/setup-python@v2 From aa2bd06076173557f1ee7b00ba6078ad08e7ff5d Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 3 Jan 2023 14:40:02 -0500 Subject: [PATCH 09/15] Revert package removals --- DESCRIPTION | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DESCRIPTION b/DESCRIPTION index e23f94e9e9..f2982b5555 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -82,4 +82,6 @@ RoxygenNote: 7.2.3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) Config/Needs/check: + rcmdcheck, + devtools, reshape2 From 951d434e74ef96603625cc072f89dfee4f9497a4 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 3 Jan 2023 14:49:51 -0500 Subject: [PATCH 10/15] Do not install from RSPM on windows --- .github/workflows/R-CMD-check.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 524c7d6b6f..338bd746bf 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -53,7 +53,9 @@ jobs: id: install-r with: r-version: ${{ matrix.config.r }} - use-public-rspm: true + # `{purrr}` v1.0.0 had trouble installing from RSPM on Windows + # https://github.com/plotly/plotly.R/pull/2221 + use-public-rspm: ${{ startsWith(matrix.config.os, 'windows') }} - uses: r-lib/actions/setup-pandoc@v2 From 568ea90bff98e4c3ff96bf51fbaad8301bfc1eba Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 3 Jan 2023 14:54:09 -0500 Subject: [PATCH 11/15] Invert logic --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 338bd746bf..54e7a12e8a 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -55,7 +55,7 @@ jobs: r-version: ${{ matrix.config.r }} # `{purrr}` v1.0.0 had trouble installing from RSPM on Windows # https://github.com/plotly/plotly.R/pull/2221 - use-public-rspm: ${{ startsWith(matrix.config.os, 'windows') }} + use-public-rspm: ${{ !startsWith(matrix.config.os, 'windows') }} - uses: r-lib/actions/setup-pandoc@v2 From 3f0b25e3c72c44c17e4cb7b02fd3eaef51e60a50 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 3 Jan 2023 15:40:16 -0500 Subject: [PATCH 12/15] Try `--no-multiarch` --- .github/workflows/R-CMD-check.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 54e7a12e8a..fa1f5c9a88 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -63,6 +63,7 @@ jobs: with: cache-version: 2 needs: check + build-args: '--no-multiarch' - name: Set up Python 3.8 uses: actions/setup-python@v2 @@ -107,7 +108,7 @@ jobs: with: check-dir: '"check"' # Run check with --no-tests since we ran them abve - args: 'c("--no-tests", "--no-manual", "--as-cran")' + args: 'c("--no-tests", "--no-manual", "--as-cran", "--no-multiarch")' error-on: '"warning"' #- name: Show testthat output From af9c154c96035266d48b562bafe448e6ebe980b6 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 3 Jan 2023 15:57:16 -0500 Subject: [PATCH 13/15] Bust cache; Use RSPM for installs --- .github/workflows/R-CMD-check.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index fa1f5c9a88..4d924e79f2 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -53,16 +53,16 @@ jobs: id: install-r with: r-version: ${{ matrix.config.r }} - # `{purrr}` v1.0.0 had trouble installing from RSPM on Windows - # https://github.com/plotly/plotly.R/pull/2221 - use-public-rspm: ${{ !startsWith(matrix.config.os, 'windows') }} + use-public-rspm: true - uses: r-lib/actions/setup-pandoc@v2 - uses: r-lib/actions/setup-r-dependencies@v2 with: - cache-version: 2 + cache-version: 3 needs: check + # 2023-01-03: `{purrr}` v1.0.0 had trouble installing from RSPM on Windows + # https://github.com/plotly/plotly.R/pull/2221 build-args: '--no-multiarch' - name: Set up Python 3.8 @@ -108,6 +108,8 @@ jobs: with: check-dir: '"check"' # Run check with --no-tests since we ran them abve + # 2023-01-03: `{purrr}` v1.0.0 had trouble installing from RSPM on Windows + # https://github.com/plotly/plotly.R/pull/2221 args: 'c("--no-tests", "--no-manual", "--as-cran", "--no-multiarch")' error-on: '"warning"' From 5f676e56abe424af9c88796b5882b75427a134c1 Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Tue, 3 Jan 2023 15:24:51 -0600 Subject: [PATCH 14/15] Update .github/workflows/R-CMD-check.yaml --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 4d924e79f2..4a4455a57c 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -61,7 +61,7 @@ jobs: with: cache-version: 3 needs: check - # 2023-01-03: `{purrr}` v1.0.0 had trouble installing from RSPM on Windows + # 2023-01-03: `{purrr}` v1.0.0 had trouble installing on Windows via pak # https://github.com/plotly/plotly.R/pull/2221 build-args: '--no-multiarch' From c9ca2f7be740c7b0c601f99cbbe625c340aef080 Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Tue, 3 Jan 2023 15:27:37 -0600 Subject: [PATCH 15/15] Apply suggestions from code review --- .github/workflows/R-CMD-check.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 4a4455a57c..fd1195d138 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -61,9 +61,6 @@ jobs: with: cache-version: 3 needs: check - # 2023-01-03: `{purrr}` v1.0.0 had trouble installing on Windows via pak - # https://github.com/plotly/plotly.R/pull/2221 - build-args: '--no-multiarch' - name: Set up Python 3.8 uses: actions/setup-python@v2 @@ -108,7 +105,7 @@ jobs: with: check-dir: '"check"' # Run check with --no-tests since we ran them abve - # 2023-01-03: `{purrr}` v1.0.0 had trouble installing from RSPM on Windows + # 2023-01-03: `{purrr}` v1.0.0 had trouble on Windows without the `--no-multiarch` # https://github.com/plotly/plotly.R/pull/2221 args: 'c("--no-tests", "--no-manual", "--as-cran", "--no-multiarch")' error-on: '"warning"'