Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 54 additions & 19 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -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}

Expand All @@ -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)'
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
Loading