Newer
Older
- test # this checks the viability of the code
- documentation-assets # this builds assets to be included in documentation
- documentation # this processes the documentation
- test-compat # this runs many additional compatibility tests
GIT_STRATEGY: clone
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
#
# Predefined conditions for triggering jobs
#
.global_trigger_check_incoming_code: &global_trigger_check_incoming_code
rules:
- if: $CI_PIPELINE_SOURCE == "external_pull_request_event"
.global_trigger_build_doc: &global_trigger_build_doc
- if: $CI_COMMIT_BRANCH == "develop"
- if: $CI_COMMIT_TAG =~ /^v/
.global_trigger_full_tests: &global_trigger_full_tests
- if: $CI_COMMIT_BRANCH == "develop"
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_COMMIT_TAG =~ /^v/
.global_trigger_compat_tests: &global_trigger_compat_tests
rules:
- if: $CI_COMMIT_BRANCH == "master"
#
# Test environment & platform settings
#
.global_env_julia15: &global_env_julia15
.global_env_julia16: &global_env_julia16
.global_env_linux: &global_env_linux
- $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/bin/julia --inline=yes --check-bounds=yes --color=yes --project=@. -e 'import Pkg; Pkg.test(; coverage = true)'
.global_env_win: &global_env_win
script:
- $global:LASTEXITCODE = 0 # Note the global prefix.
- Invoke-Expression $Env:ARTENOLIS_SOFT_PATH"\julia\"$Env:JULIA_VER"\bin\julia" --inline=yes --check-bounds=yes --color=yes --project=@. -e 'import Pkg; Pkg.test(; coverage = true)'
- exit $LASTEXITCODE
.global_env_win8: &global_env_win8
.global_env_win10: &global_env_win10
.global_env_mac: &global_env_mac
- $ARTENOLIS_SOFT_PATH/julia/$JULIA_VER/Contents/Resources/julia/bin/julia --inline=yes --check-bounds=yes --color=yes --project=@. -e 'import Pkg; Pkg.test(; coverage = true)'
#
# TESTS
#
# The "basic" required test that gets triggered for the basic testing, runs in
# any available docker and current julia
#
docker:julia1.6:
stage: test
image: $CI_REGISTRY/r3/docker/julia-custom
script:
- julia --check-bounds=yes --inline=yes --project=@. -e "import Pkg; Pkg.test(; coverage = true)"
after_script:
- julia --project=test/coverage test/coverage/coverage-summary.jl
#
# The required compatibility test to pass on branches&tags before the docs get
# built & deployed
#
linux:julia1.5:
stage: test
<<: *global_env_julia15
<<: *global_env_linux
linux:julia1.6:
stage: test
<<: *global_env_julia16
<<: *global_env_linux
#
# Additional platform&environment compatibility tests
#
windows8:julia1.5:
stage: test-compat
<<: *global_env_julia15
<<: *global_env_win8
windows8:julia1.6:
stage: test-compat
<<: *global_env_julia16
<<: *global_env_win8
windows10:julia1.5:
stage: test-compat
<<: *global_env_julia15
<<: *global_env_win10
windows10:julia1.6:
stage: test-compat
<<: *global_env_julia16
<<: *global_env_win10
mac:julia1.5:
stage: test-compat
<<: *global_env_julia15
<<: *global_env_mac
mac:julia1.6:
stage: test-compat
<<: *global_env_julia16
<<: *global_env_mac
#
image: docker:19.03.13
tags:
- privileged
services:
- name: docker:19.03.13-dind
command: ["--tls=false", "--mtu=1458", "--registry-mirror", "https://docker-registry.lcsb.uni.lu"]
before_script:
- docker login -u $CI_USER_NAME -p $GITLAB_ACCESS_TOKEN $CI_REGISTRY
- |
docker run -v "$PWD":/project $CI_REGISTRY/r3/docker/julia-custom julia -e 'using JuliaFormatter; format("/project", verbose=true);'
- |
if [ `docker run -i -v "$PWD":/git alpine/git status -s | wc -l` -ne 0 ] ; then
GITHUB_COMMENT=":red_square: Commit ${CI_COMMIT_SHORT_SHA} requires formatting!\
"$'\n\n'"Required formatting changes summary:\
"$'\n```\n'"`docker run -i -v \"$PWD\":/git alpine/git diff --stat`"$'\n```'
GITHUB_COMMENT=":green_circle: Commit ${CI_COMMIT_SHORT_SHA} is formatted properly."
- |
export GITHUB_TOKEN="${GITHUB_ACCESS_TOKEN_FORMATTER}"
export GITHUB_OWNER="lcsb-biocore"
export GITHUB_REPO="cobrexa.jl"
export GITHUB_COMMENT_TYPE=pr
export GITHUB_PR_ISSUE_NUMBER="${CI_EXTERNAL_PULL_REQUEST_IID}"
export GITHUB_COMMENT_FORMAT=""
-e GITHUB_TOKEN \
-e GITHUB_OWNER \
-e GITHUB_REPO \
-e GITHUB_COMMENT_TYPE \
-e GITHUB_PR_ISSUE_NUMBER \
-e GITHUB_COMMENT_FORMAT \
-e GITHUB_COMMENT \
cloudposse/github-commenter
# DOCUMENTATION ASSETS
#
# This builds the development history gif using gource.
documentation-assets:gource:
stage: documentation-assets
needs: [] # allow faster start
image: docker:19.03.13
tags:
- privileged
command: ["--tls=false", "--mtu=1458", "--registry-mirror", "https://docker-registry.lcsb.uni.lu"]
before_script:
- docker login -u $CI_USER_NAME -p $GITLAB_ACCESS_TOKEN $CI_REGISTRY
- docker run -v "$PWD":/visualization $CI_REGISTRY/r3/docker/gource
paths: ['output.gif']
# DOCUMENTATION TESTS
#
# In pull requests, triggered after the tests succeed to avoid unnecessary
# double failure. In normal branch testing, these get triggered with normal
# tests (the error should be visible ASAP). We avoid a separate stage to keep
# the pipeline parallelizable.
image: $CI_REGISTRY/r3/docker/julia-custom
script:
- julia --project=@. -e 'import Pkg; Pkg.instantiate();'
- julia --project=@. --color=yes test/doctests.jl
# this gets triggered on pull requests after the tests (to avoid unnecessary
# double failure if the tests fail already)
doc-tests-pr:julia1.6:
stage: documentation
<<: *global_doctests
<<: *global_trigger_check_incoming_code
# this gets triggered in comprehensive tests
doc-tests:julia1.6:
stage: test
<<: *global_doctests
<<: *global_trigger_full_tests
# Note: This dependency is also implied by the stage ordering, but let's
# be sure. As of Nov 2021, the assets are not used directly, but referred
# to externally from the docs.
image: $CI_REGISTRY/r3/docker/julia-custom
script:
# resolve and build packages from the docs/Project.toml file
- julia --project=docs -e 'using Pkg; Pkg.resolve(); Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate();'
# deploy doc (the without git history)
# move to the directory picked up by Gitlab pages (with git history)
- mv docs/build public
# EXTERNAL REPOSITORIES
#
# This trigger the test pipeline in external repo as defined by gitlab
# variables.

Laurent Heirendt
committed
trigger:
- curl --silent --output /dev/null -X POST -F token=$EXTERNAL_REPO_TOKEN -F ref=$EXTERNAL_REPO_BRANCH $EXTERNAL_REPO