From 76f54ae614346755c07396420acf5a71a5a189a0 Mon Sep 17 00:00:00 2001 From: arnejh Date: Tue, 2 Sep 2025 23:48:47 +0200 Subject: [PATCH] Updated the pkgdown.yaml to be consistent with RstoxData, RstoxBase and RstoxFramework. --- .github/workflows/pkgdown.yaml | 73 +++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 6eee9277..c4405cd9 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -1,40 +1,75 @@ on: push: - branches: - - main - - master + branches: master name: pkgdown jobs: pkgdown: + # Use macOS here to speed up by binary R package install (and Windows may have more issues, such as Rtools) runs-on: macOS-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 + with: + r-version: release - uses: r-lib/actions/setup-pandoc@v2 - - name: Query dependencies + - name: Install MacOS system dependencies + # We are on macOS as per the "runs-on": + #if: runner.os == 'macOS' 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 R package cache - uses: actions/cache@v3 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + # gfortran may not exist in a period after a new R minor release: + gfortranFile='/usr/local/bin/gfortran' + if [ -f "$gfortranFile" ] ; then + rm "$gfortranFile" + fi + rm -f '/usr/local/bin/2to3' + rm -f '/usr/local/bin/2to3-3.11' + rm -f '/usr/local/bin/idle3' + rm -f '/usr/local/bin/idle3.11' + rm -f '/usr/local/bin/pydoc3' + rm -f '/usr/local/bin/pydoc3.11' + rm -f '/usr/local/bin/python3' + rm -f '/usr/local/bin/python3.11' + rm -f '/usr/local/bin/python3-config' + rm -f '/usr/local/bin/python3.11-config' + rm -f '/usr/local/bin/gfortran' + export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK= # This (the value should actually be empty...) prevents Homebrew from re-installing R, which will lead to .Platform$pkgType = "source". + brew install gdal + shell: bash - - name: Install dependencies + - name: Install R package dependencies run: | - remotes::install_deps(dependencies = TRUE) + # We hard code the list of top level dependencies, since the behavior of remotes::install_deps() that we used before is very unclear (e.g. how is the Additional_repositories included in the list of repos?): + topLevelDeps <- c( + # Imports: + "data.table", + "ggplot2", + "gridExtra", + "methods", + "RColorBrewer", + "rnaturalearth", + "rnaturalearthdata", + "RstoxData", + "RstoxBase", + "sf", + # Suggests: + "knitr", + "rmarkdown", + "tinytest" + ) + install.packages( + topLevelDeps, + dependencies = TRUE, + repos = c("https://stoxproject.github.io/unstableRepo/", "https://cloud.r-project.org/") + ) + + # Used in "Deploy package" below: install.packages("pkgdown", type = "binary") shell: Rscript {0} @@ -45,4 +80,4 @@ jobs: run: | git config --local user.email "actions@github.com" git config --local user.name "GitHub Actions" - Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' \ No newline at end of file + Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'