Commit 635dc360 authored by Timo Koch's avatar Timo Koch Committed by Dennis Gläser
Browse files

[ci] Trigger pipeline as a child pipeline

parent 386168b8
default:
image: registry.dune-project.org/docker/ci/dune:2.7-debian-11-gcc-9-20
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- dep_modules
stages:
- build
- test
- trigger pipelines
# rules for build & test:
# - pipelines are built for commits to master, tags, merge requests
# - Within merge requests, we require manual trigger of the build stage
# to start off the pipeline
.build_rules:
# rules for the default triggers:
# - pipelines are triggered for commits to master, tags, merge requests
# - Within merge requests, we require to start the pipeline manually
# by clicking play for the trigger
.default-trigger:
stage: trigger pipelines
trigger:
include:
- local: .gitlab-ci/default.yml
strategy: depend
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE=="pipeline"
- if: $CI_PIPELINE_SOURCE == "pipeline"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: manual
.test_rules:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE=="pipeline"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
build lecture:
extends: .build_rules
stage: build
before_script:
- mkdir -p dep_modules; cd dep_modules
- git clone -b releases/2.7 https://gitlab.dune-project.org/extensions/dune-foamgrid.git
- git clone -b releases/2.7 https://gitlab.dune-project.org/extensions/dune-alugrid.git
- git clone -b master https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git
- dunecontrol --opts=/duneci/dune.opts --only=dune-foamgrid all
- dunecontrol --opts=/duneci/dune.opts --only=dune-alugrid all
- dunecontrol --opts=/duneci/dune.opts --only=dumux all
- cd ..
script:
- cd ..
- dunecontrol --opts=/duneci/dune.opts --only=dumux-lecture all
- cd dumux-lecture/build-cmake
- make -j 8 build_tests
artifacts:
paths:
- build-cmake
expire_in: 3 hours
debian11-gcc9-cpp20:
extends: .default-trigger
variables:
IMAGE: registry.dune-project.org/docker/ci/dune:2.7-debian-11-gcc-9-20
test lecture:
extends: .test_rules
stage: test
script:
- cd build-cmake
- duneci-ctest -j4 --no-tests=error
needs:
- job: build lecture
artifacts: true
ubuntu18.04-clang6-cpp17:
extends: .default-trigger
variables:
IMAGE: registry.dune-project.org/docker/ci/dune:2.7-ubuntu-18.04-clang-6-17
default:
image: $IMAGE
cache:
key: ${CI_COMMIT_REF_SLUG}-$IMAGE
paths:
- dep_modules
stages:
- build
- test
workflow:
rules:
- if: $CI_PIPELINE_SOURCE=="parent_pipeline"
build lecture:
stage: build
before_script:
- mkdir -p dep_modules
- pushd dep_modules
- >
if [ ! -d dune-foamgrid ]; then
git clone -b releases/2.7 --depth 1 https://gitlab.dune-project.org/extensions/dune-foamgrid.git;
dunecontrol --opts=/duneci/dune.opts --only=dune-foamgrid all;
fi
- >
if [ ! -d dune-alugrid ]; then
git clone -b releases/2.7 --depth 1 https://gitlab.dune-project.org/extensions/dune-alugrid.git;
dunecontrol --opts=/duneci/dune.opts --make-options="-j8" --only=dune-alugrid all;
fi
- >
if [ ! -d dumux ]; then
git clone -b master --depth 1 https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git;
dunecontrol --opts=/duneci/dune.opts --only=dumux all
fi
- popd
script:
- cd ..
- dunecontrol --opts=/duneci/dune.opts --only=dumux-lecture all
- cd dumux-lecture/build-cmake
- make -k -j 8 build_tests
artifacts:
paths:
- build-cmake
expire_in: 3 hours
test lecture:
stage: test
script:
- cd build-cmake
- duneci-ctest -j4 --no-tests=error
needs:
- job: build lecture
artifacts: true
Markdown is supported
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