-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
31 lines (30 loc) · 1.27 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
test:
image: $CI_REGISTRY_IMAGE:latest #rocker/tidyverse
stage: test
tags:
- envinf2
variables:
R_LIBS_USER: "$CI_PROJECT_DIR/ci/lib/"
RETICULATE_MINICONDA_PATH: "/root/.local/share/r-miniconda/"
RETICULATE_PYTHON_ENV: "/root/.local/share/r-miniconda/envs/r-reticulate/"
CHECK_DIR: "$CI_PROJECT_DIR/ci/logs/"
BUILD_LOGS_DIR: "$CI_PROJECT_DIR/ci/logs/$CI_PROJECT_NAME.Rcheck"
script:
- if [ ! -d "$R_LIBS_USER" ]; then mkdir -p "$R_LIBS_USER"; fi
- if [ ! -d "$BUILD_LOGS_DIR" ]; then mkdir -p "$BUILD_LOGS_DIR"; fi
- R -e 'withr::with_libpaths(new = Sys.getenv("R_LIBS_USER"), {devtools::install_deps(dependencies = T);install.packages("plyr")})'
- R -e '.libPaths(new = Sys.getenv("R_LIBS_USER"))'
- R CMD build . --no-build-vignettes --no-manual
- R CMD check $(ls -1t *.tar.gz | head -n 1) -o $CHECK_DIR --no-build-vignettes --no-manual
cache:
key: $CI_COMMIT_REF_SLUG
untracked: true
paths:
- $R_LIBS_USER
artifacts:
paths:
- $BUILD_LOGS_DIR
when: "always"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "web"'
- if: '$CI_COMMIT_BRANCH == "master"'