Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
98b94179
Commit
98b94179
authored
Apr 29, 2021
by
Bernd Flemisch
Browse files
Merge branch 'feature/improve-ci' into 'master'
always run test-selection stage See merge request
!2576
parents
c38063eb
385f4c4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
98b94179
stages
:
-
configure
-
trigger
-
downstream modules
...
...
@@ -12,42 +11,10 @@ variables:
workflow
:
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "schedule"
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
################################################################################
# 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 selection stage before #
# the 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. #
################################################################################
select-pipeline
:
image
:
$IMAGE_REGISTRY_URL/full:dune-2.7-gcc-ubuntu-20.04
stage
:
configure
script
:
-
|
if [ $CI_PIPELINE_SOURCE == "merge_request_event" ]; then
cp .gitlab-ci/affectedtestsonly.yml pipeline-config.yml
else
cp .gitlab-ci/default.yml pipeline-config.yml
fi
artifacts
:
paths
:
-
pipeline-config.yml
expire_in
:
3 hours
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "schedule"
when
:
always
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when
:
manual
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
when
:
manual
###################################################################################
# Stage
2
: trigger the Dumux test pipelines #
# 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 #
...
...
@@ -57,13 +24,14 @@ select-pipeline:
# basic trigger job to start the test pipeline
.base-trigger
:
stage
:
trigger
needs
:
-
select-pipeline
trigger
:
include
:
-
artifact
:
pipeline-config.yml
job
:
select-pipeline
include
:
.gitlab-ci/default.yml
strategy
:
depend
variables
:
TRIGGER_SOURCE
:
$CI_PIPELINE_SOURCE
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
when
:
manual
# trigger for jobs that should not be created in merge requests
.non-mr-trigger
:
...
...
@@ -102,7 +70,7 @@ full-dune-master-clang:
#########################################################
# Stage
3
: trigger test pipelines of downstream modules #
# Stage
2
: trigger test pipelines of downstream modules #
#########################################################
# trigger lecture test
...
...
.gitlab-ci/affectedtestsonly.yml
deleted
100644 → 0
View file @
c38063eb
default
:
image
:
$IMAGE
stages
:
-
configure
-
build
-
test
workflow
:
rules
:
-
if
:
$CI_PIPELINE_SOURCE=="parent_pipeline"
select tests
:
stage
:
configure
script
:
-
dunecontrol --opts=$DUNE_OPTS_FILE --current all
-
|
pushd build-cmake
python3 ../bin/testing/findtests.py -f affectedtests.json -t origin/master
popd
artifacts
:
paths
:
-
build-cmake
expire_in
:
3 hours
build dumux
:
stage
:
build
script
:
-
|
pushd build-cmake
make clean
python3 ../bin/testing/runselectedtests.py -c affectedtests.json -b
popd
artifacts
:
paths
:
-
build-cmake
expire_in
:
3 hours
needs
:
-
job
:
select tests
artifacts
:
true
test dumux
:
stage
:
test
script
:
-
|
pushd build-cmake
python3 ../bin/testing/runselectedtests.py -c affectedtests.json -t
popd
needs
:
-
job
:
build dumux
artifacts
:
true
artifacts
:
reports
:
junit
:
junit/dumux-cmake.xml
.gitlab-ci/default.yml
View file @
98b94179
...
...
@@ -2,6 +2,7 @@ default:
image
:
$IMAGE
stages
:
-
configure
-
build
-
test
...
...
@@ -9,20 +10,60 @@ workflow:
rules
:
-
if
:
$CI_PIPELINE_SOURCE=="parent_pipeline"
variables
:
TRIGGER_SOURCE
:
"
unknown"
select tests
:
stage
:
configure
image
:
$IMAGE_REGISTRY_URL/full:dune-2.7-gcc-ubuntu-20.04
script
:
-
|
if [[ "$TRIGGER_SOURCE" == "merge_request_event" ]]; then
dunecontrol --opts=$DUNE_OPTS_FILE --current all
pushd build-cmake
python3 ../bin/testing/findtests.py -f ../affectedtests.json -t origin/master
popd
else
echo "Skipping test selection, build/test stages will consider all tests!"
echo "{}" >> ../affectedtests.json
fi
artifacts
:
paths
:
-
affectedtests.json
expire_in
:
3 hours
build dumux
:
stage
:
build
script
:
-
dunecontrol --opts=$DUNE_OPTS_FILE --current all
-
dunecontrol --opts=$DUNE_OPTS_FILE --current bexec make -k -j4 build_tests
-
|
pushd build-cmake
if [[ "$TRIGGER_SOURCE" == "merge_request_event" ]]; then
python3 ../bin/testing/runselectedtests.py -c ../affectedtests.json -b
else
python3 ../bin/testing/runselectedtests.py --all -b
fi
popd
artifacts
:
paths
:
-
build-cmake
-
affectedtests.json
expire_in
:
3 hours
needs
:
-
job
:
select tests
artifacts
:
true
test dumux
:
stage
:
test
script
:
-
dunecontrol --opts=$DUNE_OPTS_FILE --current bexec dune-ctest -j4 --output-on-failure
-
|
pushd build-cmake
if [[ "$TRIGGER_SOURCE" == "merge_request_event" ]]; then
python3 ../bin/testing/runselectedtests.py -c ../affectedtests.json -t
else
python3 ../bin/testing/runselectedtests.py --all -t
fi
popd
needs
:
-
job
:
build dumux
artifacts
:
true
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment