inbo / n2khab

R package with preprocessing functions and standard reference data for Flemish Natura 2000 (N2K) habitat (HAB) analyses
https://inbo.github.io/n2khab
GNU General Public License v3.0
2 stars 1 forks source link

Github Actions: conditional installation of system dependencies on macOS #125

Closed florisvdh closed 3 years ago

florisvdh commented 3 years ago

In #123 a patch was added for macos-latest to pre-install udunits and gdal. However this largely inflates check duration, wich is especially annoying as both Ubuntu and Windows now get under 5-6 minutes by #123 and #124 (especially in the presence of an R packages cache).

The following workaround appeared to work for now: only install the system dependencies when no package cache is available yet (i.e. on a new branch, for the first commit since 7 days). The problem with lacking sysdeps on macos (#120) arose during the installation of R package dependencies that needed to be built from source; in this case sf :smile_cat:.

So when using a package cache and not installing the associated system libraries, the process won't complain about a non-functional sf package as long as it isn't re-installed or called! From the first observation, this reduced the check duration from > 11 min to approximately 6 min. Still, check duration seems to easily vary for the macOS machine when repeating the same job - delays seem to occur in this build machine.

When we'd add unit tests to n2khab in which sf or raster are called, then it will be another story. So consider this a hack.