Commit 8fba1fba authored by Johannes Boog's avatar Johannes Boog Committed by phit0
Browse files

[test] add ci pipeline

[ci] install_deps() and cache

[ci] python dependencies

[ci] run only on merge requests

[ci] implement cache for speed

[ci] python library cache try2

[ci] python library cache try 3

[ci] debug

[ci] debug2

[ci] set R library path

[ci] change R lib variable name

[ci] try cache for r-miniconda

[ci] mkdir only if directory does not exist (prevent overwriting cache)

[ci] variable for python env

[ci] see if variable can be set in R session

[ci] RETICULATE_PYTHON

[ci] creating reticulate python libraries is a mess

[ci] check if miniconda dir exists

[ci] check if vtk is available

[base] add foreach into imports, as it is causing the error

debug "cannot create directory"

mkdir -p

install deps without if

test pipeline on other frontend

specify dependency directory
parent 488fbb0e
Pipeline #6930 passed with stage
in 2 minutes and 8 seconds
......@@ -6,6 +6,7 @@
^inst/examples/Theis_well_pumping
^LICENSE.md
^config.yml
^.gitlab-ci.yml
^doc$
^Meta$
^data-raw$
image: rocker/tidyverse
test:
stage: test
tags:
- envinf2
variables:
R_LIBS_USER: "$CI_PROJECT_DIR/ci/lib/"
RETICULATE_MINICONDA_PATH: "/root/.local/share/r-miniconda/" #default path
RETICULATE_PYTHON_ENV: "/root/.local/share/r-miniconda/envs/r-reticulate/"
# RETICULATE_PYTHON: "$CI_PROJECT_DIR/ci/r-miniconda/envs/r-reticulate/bin/python3"
script:
- if [ ! -d "$R_LIBS_USER" ]; then mkdir -p "$R_LIBS_USER"; fi
- R -e 'withr::with_libpaths(new = Sys.getenv("R_LIBS_USER"), devtools::install_deps(dependencies = T))'
# checks if the packages from the Imports, Suggests, LinkinTo field
# are already installed in the cache
- R -e '.libPaths(new = Sys.getenv("R_LIBS_USER"))'
# python dependencies
- if [ ! -d "$RETICULATE_MINICONDA_PATH" ]; then R -e 'reticulate::install_miniconda()'; fi
- R -e 'if(tryCatch(reticulate::import("vtk"), error = function(e) return(TRUE))) reticulate::py_install("vtk")'
- R CMD build . --no-build-vignettes --no-manual
- R CMD check $(ls -1t *.tar.gz | head -n 1) --no-build-vignettes --no-manual
cache:
key: "$CI_COMMIT_REF_SLUG"
untracked: true
paths:
- "$R_LIBS_USER"
- "$RETICULATE_MINICONDA_PATH"
- "$RETICULATE_PYTHON_ENV"
# script will only run then attempting to merge/push to master
only:
- merge_requests
\ No newline at end of file
......@@ -38,9 +38,9 @@ Imports:
doParallel,
reticulate,
config,
sticky
sticky,
foreach
RoxygenNote: 7.1.1
VignetteBuilder: knitr
Depends:
foreach,
R (>= 2.10)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment