From c76f4937e67289118424391a75ec4d37d09243f6 Mon Sep 17 00:00:00 2001 From: Paolo Cozzi Date: Mon, 24 Jun 2024 17:17:24 +0200 Subject: [PATCH 1/7] :construction_worker: update CI system --- .github/workflows/R-CMD-check.yaml | 11 +++++------ .github/workflows/lint.yaml | 10 ++++++---- .github/workflows/pkgdown.yaml | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index a864543..b1cce8a 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -33,7 +33,7 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies on Linux if: runner.os == 'Linux' @@ -44,18 +44,17 @@ jobs: if: runner.os == 'macOS' run: brew install gdal - - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - - uses: r-lib/actions/setup-renv@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - cache-version: 1 - profile: '"dev"' + cache-version: 2 + extra-packages: | + any::rcmdcheck - uses: r-lib/actions/check-r-package@v2 with: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index f092027..cd80853 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -16,7 +16,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install dependencies on Linux run: sudo apt-get update -y && sudo apt-get install -y libcurl4-openssl-dev @@ -26,10 +26,12 @@ jobs: with: use-public-rspm: true - - uses: r-lib/actions/setup-renv@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - cache-version: 1 - profile: '"dev"' + cache-version: 2 + extra-packages: | + any::rcmdcheck + any::lintr - name: Lint run: lintr::lint_package() diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index daabfe9..1ad13a3 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -20,7 +20,7 @@ jobs: SMARTER_API_PASSWORD: ${{ secrets.SMARTER_API_PASSWORD }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install dependencies on Linux run: sudo apt-get update -y && sudo apt-get install -y libcurl4-openssl-dev From 4ac68239088b7061f75da14af8b2b929e0b4b652 Mon Sep 17 00:00:00 2001 From: Paolo Cozzi Date: Mon, 24 Jun 2024 17:33:19 +0200 Subject: [PATCH 2/7] :construction_worker: attempt to limit dependencies --- .github/workflows/R-CMD-check.yaml | 1 + .github/workflows/lint.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index b1cce8a..337373e 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -53,6 +53,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: cache-version: 2 + dependencies: '"hard"' extra-packages: | any::rcmdcheck diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index cd80853..7f452e4 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -29,8 +29,8 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: cache-version: 2 + dependencies: '"hard"' extra-packages: | - any::rcmdcheck any::lintr - name: Lint From 0df16f57ea9d280886c09e09b03c932581ce987f Mon Sep 17 00:00:00 2001 From: Paolo Cozzi Date: Mon, 24 Jun 2024 17:52:35 +0200 Subject: [PATCH 3/7] :green_heart: add missing package --- .github/workflows/R-CMD-check.yaml | 3 ++- .github/workflows/lint.yaml | 2 +- .github/workflows/pkgdown.yaml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 337373e..31984b7 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -52,10 +52,11 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - cache-version: 2 + cache-version: 1 dependencies: '"hard"' extra-packages: | any::rcmdcheck + any::knitr - uses: r-lib/actions/check-r-package@v2 with: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 7f452e4..379a51b 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -28,7 +28,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - cache-version: 2 + cache-version: 1 dependencies: '"hard"' extra-packages: | any::lintr diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 1ad13a3..4260aec 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -34,7 +34,7 @@ jobs: - uses: r-lib/actions/setup-renv@v2 with: - cache-version: 2 + cache-version: 1 - name: Build site run: pkgdown::build_site_github_pages(new_process = FALSE, install = TRUE) From 3a6426e1f3d46b9ead1a9967583a541a7eef6d11 Mon Sep 17 00:00:00 2001 From: Paolo Cozzi Date: Mon, 24 Jun 2024 20:11:46 +0200 Subject: [PATCH 4/7] :green_heart: install all required dependencies since the default test is c("--no-manual", "--as-cran"), all the suggested packages to build the vignettes are required --- .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 31984b7..ba9422a 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -53,10 +53,8 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: cache-version: 1 - dependencies: '"hard"' extra-packages: | any::rcmdcheck - any::knitr - uses: r-lib/actions/check-r-package@v2 with: From 4ca987706d6a66f5c35252008c6698818c21667a Mon Sep 17 00:00:00 2001 From: Paolo Cozzi Date: Tue, 25 Jun 2024 12:07:08 +0200 Subject: [PATCH 5/7] :construction_worker: pristine renv install actions There are no significant differences between renv and the standard actions which install renv dependency --- .github/workflows/R-CMD-check.yaml | 5 ++--- .github/workflows/lint.yaml | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 66192f9..dd1daef 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -50,11 +50,10 @@ jobs: http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v2 + - uses: r-lib/actions/setup-renv@v2 with: cache-version: 1 - extra-packages: | - any::rcmdcheck + profile: '"dev"' - uses: r-lib/actions/check-r-package@v2 with: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 49fec53..98e436b 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -26,12 +26,10 @@ jobs: with: use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v2 + - uses: r-lib/actions/setup-renv@v2 with: cache-version: 1 - dependencies: '"hard"' - extra-packages: | - any::lintr + profile: '"dev"' - name: Lint run: lintr::lint_package() From 150148ef596b02273584327e31c703321799fcf3 Mon Sep 17 00:00:00 2001 From: Paolo Cozzi Date: Tue, 25 Jun 2024 12:08:19 +0200 Subject: [PATCH 6/7] :construction_worker: test simple install in multiple architectures attempt to fully test in ubuntu environment and to simply install in different architectures --- .github/workflows/R-CMD-check.yaml | 22 +++-------- .github/workflows/install.yaml | 63 ++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/install.yaml diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index dd1daef..de96d2e 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -16,17 +16,7 @@ env: jobs: R-CMD-check: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - - {os: macos-latest, r: 'release'} - - {os: windows-latest, r: 'release'} - - {os: ubuntu-latest, r: 'release'} + runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -40,14 +30,12 @@ jobs: run: sudo apt-get update -y && sudo apt-get install -y libcurl4-openssl-dev libgdal-dev libudunits2-dev libharfbuzz-dev libfribidi-dev - - name: Install dependencies on MacOS - if: runner.os == 'macOS' - run: brew install gdal + - uses: r-lib/actions/setup-pandoc@v2 - uses: r-lib/actions/setup-r@v2 with: - r-version: ${{ matrix.config.r }} - http-user-agent: ${{ matrix.config.http-user-agent }} + r-version: 'release' + http-user-agent: 'default' use-public-rspm: true - uses: r-lib/actions/setup-renv@v2 @@ -68,5 +56,5 @@ jobs: if: failure() uses: actions/upload-artifact@main with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results + name: Linux-rrelease-results path: check diff --git a/.github/workflows/install.yaml b/.github/workflows/install.yaml new file mode 100644 index 0000000..190a192 --- /dev/null +++ b/.github/workflows/install.yaml @@ -0,0 +1,63 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [master] + pull_request: + branches: [master, devel] + +name: install + +env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + SMARTER_API_USERNAME: ${{ secrets.SMARTER_API_USERNAME }} + SMARTER_API_PASSWORD: ${{ secrets.SMARTER_API_PASSWORD }} + +jobs: + install: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {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'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + + - name: Install dependencies on Linux + if: runner.os == 'Linux' + run: sudo apt-get update -y && sudo apt-get install -y libcurl4-openssl-dev + libgdal-dev libudunits2-dev libharfbuzz-dev libfribidi-dev + + - name: Install dependencies on MacOS + if: runner.os == 'macOS' + run: brew install gdal + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + cache-version: 1 + dependencies: '"hard"' + extra-packages: | + any::devtools + + - name: Install package with devtools + run: devtools::install_github("cnr-ibba/r-smarter-api") + shell: Rscript {0} From 9ea1b6145c62682ed24aa787a85434cc54dbc419 Mon Sep 17 00:00:00 2001 From: Paolo Cozzi Date: Tue, 25 Jun 2024 12:17:52 +0200 Subject: [PATCH 7/7] :green_heart: install devtools as R CMD --- .github/workflows/install.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/install.yaml b/.github/workflows/install.yaml index 190a192..a2c9aae 100644 --- a/.github/workflows/install.yaml +++ b/.github/workflows/install.yaml @@ -51,12 +51,9 @@ jobs: http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - cache-version: 1 - dependencies: '"hard"' - extra-packages: | - any::devtools + - name: Install devtools dependency + run: install.packages("devtools") + shell: Rscript {0} - name: Install package with devtools run: devtools::install_github("cnr-ibba/r-smarter-api")