Newer
Older
variables:
IMAGE_REGISTRY_URL: $CI_REGISTRY/dumux-repositories/dumux-docker-ci
# Cases in which to create pipelines at all. The trigger jobs may further
# specify how exactly they should be created in different situations.
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "pipeline"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == "master"
# for commits happening on master, we check if there was a successful
# pipeline on a related merge request already. If yes, we simply return
# to propagate that pipeline status on master. Otherwise, we trigger a new run.
check-pipeline-status:
image: $IMAGE_REGISTRY_URL/full:dune-2.7-gcc-ubuntu-20.04
stage: check-status
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_COMMIT_BRANCH == "master"
when: always
script:
- |
curl --header --form "token=$CI_JOB_TOKEN" \
"https://git.iws.uni-stuttgart.de/api/v4/projects/31/pipelines/?status=success" \
> pipeline_status.json
- |
if ! python3 .gitlab-ci/getpipelineinfo.py --status-file pipeline_status.json \
--look-for HEAD \
--print-format pipeline-id; then
echo "No successful pipeline found. Triggering new pipeline..."
curl --request POST --form "token=$CI_JOB_TOKEN" \
--form ref=$CI_COMMIT_BRANCH \
"https://git.iws.uni-stuttgart.de/api/v4/projects/31/trigger/pipeline"
else
echo "Found successful pipeline for the current state of the branch"
fi
###################################################################################
# Stage 1: trigger the Dumux test pipelines #
# In this stage, we trigger the test pipeline with different configurations, i.e. #
# different Dune versions, compilers, etc. Within merge requests, we create three #
# test pipelines including two different compilers and a full and minimal setup #
# of dependencies. In all other situations, additional test jobs are created. #
###################################################################################
# basic trigger job to start the test pipeline
.base-trigger:
variables:
TRIGGER_SOURCE: $CI_PIPELINE_SOURCE
COMMIT_BRANCH: $CI_COMMIT_BRANCH
MR_TARGET_BRANCH_NAME: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
- if: $CI_PIPELINE_SOURCE == "schedule"
when: always
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: always
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: manual
# trigger for jobs that should not be created in merge requests
- if: $CI_PIPELINE_SOURCE == "schedule"
#############################################
# pipelines to be created in merge requests #
variables:
IMAGE: $IMAGE_REGISTRY_URL/full:dune-2.7-gcc-ubuntu-20.04
minimal-dune-2.7-gcc:
variables:
IMAGE: $IMAGE_REGISTRY_URL/minimal:dune-2.7-gcc-ubuntu-20.04
full-dune-2.7-clang:
variables:
IMAGE: $IMAGE_REGISTRY_URL/full:dune-2.7-clang-ubuntu-20.04
##################################
# additional scheduled pipelines #
full-dune-master-gcc:
variables:
IMAGE: $IMAGE_REGISTRY_URL/full:dune-master-gcc-ubuntu-20.04
full-dune-master-clang:
variables:
IMAGE: $IMAGE_REGISTRY_URL/full:dune-master-clang-ubuntu-20.04
#########################################################
# Stage 2: trigger test pipelines of downstream modules #
#########################################################
# trigger lecture test
trigger lecture:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "pipeline"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
stage: downstream modules
trigger:
project: dumux-repositories/dumux-lecture
DUMUX_PIPELINE_SOURCE: $CI_PIPELINE_SOURCE
DUMUX_MERGE_REQUEST_SOURCE_BRANCH: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
DUMUX_MERGE_REQUEST_TARGET_BRANCH: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME