Newer
Older
# helpful Links:
# https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
# https://www.youtube.com/watch?v=7I6tHw68DMQ
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/"
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"))'
- R -e 'withr::with_libpaths(new = Sys.getenv("R_LIBS_USER"), {install.packages("BiocManager"); BiocManager::install("rhdf5")})'
- R CMD build . --no-build-vignettes --no-manual
- R CMD check $(ls -1t *.tar.gz | head -n 1) --no-build-vignettes --no-manual
after_script:
- R -e 'covr::package_coverage(type = c("tests", "examples"), quiet = F)'
coverage: '/Coverage: \d+\.\d+\%/'
cache:
key: "$CI_COMMIT_REF_SLUG"
untracked: true
paths:
- "$R_LIBS_USER"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "web"'
benchmark:ref:
stage: test-benchmarks
tags:
- envinf1
image: "$CI_REGISTRY_IMAGE"
variables:
R_LIBS_USER: "$CI_PROJECT_DIR/ci/lib/"
# change this as needed
OGS_VERSION: "6.4.1"
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: on_success
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))'
- R -e '.libPaths(new = Sys.getenv("R_LIBS_USER"))'
- Rscript ./ci/test_bm_script.R "$OGS_VERSION" "ref"
cache:
key: "$CI_COMMIT_REF_SLUG"
untracked: true
paths:
- "$R_LIBS_USER"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
expire_in: 4 hrs
benchmark:r2ogs6:
stage: test-benchmarks
tags:
- envinf1
image: "$CI_REGISTRY_IMAGE"
variables:
R_LIBS_USER: "$CI_PROJECT_DIR/ci/lib/"
# change this as needed
OGS_VERSION: "6.4.1"
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: on_success
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))'
- R -e '.libPaths(new = Sys.getenv("R_LIBS_USER"))'
- Rscript ./ci/test_bm_script.R "$OGS_VERSION" "r2ogs6"
cache:
key: "$CI_COMMIT_REF_SLUG"
untracked: true
paths:
- "$R_LIBS_USER"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
expire_in: 4 hrs
compare-benchmarks:
needs: ["benchmark:ref", "benchmark:r2ogs6"]
stage: test-benchmarks
tags:
- envinf1
image: "$CI_REGISTRY_IMAGE"
dependencies:
- benchmark:ref
- benchmark:r2ogs6
- Rscript ./ci/test_bm_script.R "$OGS_VERSION" "test"