Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
db3068f3
Commit
db3068f3
authored
3 years ago
by
Dennis Gläser
Browse files
Options
Downloads
Patches
Plain Diff
[ci] define creation rules in jobs
parent
a7fc0412
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2408
Feature/ci integration
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+21
-17
21 additions, 17 deletions
.gitlab-ci.yml
.gitlab-ci/makepipelineconfig.py
+2
-1
2 additions, 1 deletion
.gitlab-ci/makepipelineconfig.py
with
23 additions
and
18 deletions
.gitlab-ci.yml
+
21
−
17
View file @
db3068f3
stages
:
-
pipeline
config
-
t
est pipelines
-
config
ure
-
t
rigger
# - downstream modules
variables
:
IMAGE_REGISTRY_URL
:
$CI_REGISTRY/dumux-repositories/dumux-docker-ci
# Cases in which to create a pipeline. The `generate-config` job further
# specifies the situations in which they must be started manually.
workflow
:
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "schedule"
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when
:
manual
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
when
:
manual
################################################################################
###
# Stage 1: configure the test pipeline.
#
# This creates the .yml to be used for the test pipeline trigger stage. Within
#
# merge request, we create a .yml file that
considers building and ex
ec
u
ti
ng only
#
# th
ose test that are
affected by
the
changes introduced in the
merge request.
#
# In all other cases, we use the default
configuration
which runs all tests.
#
################################################################################
###
################################################################################
# Stage 1: configure the test pipeline. #
# This creates the .yml to be used for the test pipeline trigger stage. Within #
# merge request, we create a .yml file that
adds a test sel
ecti
on stage before
#
# th
e build stage to identify the tests
affected by changes introduced in the #
#
merge request.
In all other cases, we use the default which runs all tests. #
################################################################################
generate-config
:
image
:
$IMAGE_REGISTRY_URL/full:dune-2.7-gcc-ubuntu-20.04
stage
:
pipeline
config
stage
:
config
ure
script
:
-
dunecontrol --opts=$DUNE_OPTS_FILE --current all
-
|
if [ $CI_PIPELINE_SOURCE == "merge_request_event" ]; then
cd build-cmake
python3 ../bin/testing/findtests.py -f affectedtests.json -t origin/master
python3
../
.gitlab-ci/makepipelineconfig.py -c affectedtests.json -o
../
generated-config.yml
dunecontrol --opts=$DUNE_OPTS_FILE --current all
pushd build-cmake &&
python3 ../bin/testing/findtests.py -f affectedtests.json -t origin/master
&& popd
python3 .gitlab-ci/makepipelineconfig.py -c
build-cmake/
affectedtests.json -o generated-config.yml
else
python3 .gitlab-ci/makepipelineconfig.py -o generated-config.yml
fi
...
...
@@ -38,6 +37,11 @@ generate-config:
paths
:
-
generated-config.yml
expire_in
:
3 hours
rules
:
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when
:
manual
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
when
:
manual
###################################################################################
# Stage 2: trigger the test pipelines #
...
...
@@ -49,7 +53,7 @@ generate-config:
# basic trigger job to start the test pipeline
.base-trigger
:
stage
:
t
est pipelines
stage
:
t
rigger
needs
:
-
generate-config
trigger
:
...
...
This diff is collapsed.
Click to expand it.
.gitlab-ci/makepipelineconfig.py
+
2
−
1
View file @
db3068f3
...
...
@@ -63,7 +63,8 @@ with open(args['outfile'], 'w') as ymlFile:
# we let the script create a small custom makeFile here on top of
# `Makefile2`, where we define a new target to be built in parallel
buildCommand
=
[
'
rm TestMakefile
'
,
'
touch TestMakefile
'
,
'
rm -f TestMakefile
'
,
'
touch TestMakefile
'
,
'
echo
"
include CMakeFiles/Makefile2
"
>> TestMakefile
'
,
'
echo
""
>> TestMakefile
'
,
'
echo
"
build_selected_tests: {}
"
>> TestMakefile
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment