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-lecture
Commits
34294ef2
Commit
34294ef2
authored
May 19, 2021
by
Dennis Gläser
Committed by
Dennis
May 25, 2021
Browse files
[ci] add test selection stage
parent
5d7eff39
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
34294ef2
...
@@ -5,10 +5,9 @@ variables:
...
@@ -5,10 +5,9 @@ variables:
IMAGE_REGISTRY_URL
:
$CI_REGISTRY/dumux-repositories/dumux-docker-ci
IMAGE_REGISTRY_URL
:
$CI_REGISTRY/dumux-repositories/dumux-docker-ci
# rules for the default triggers:
# rules for the default triggers:
# - pipelines are triggered for
commits to master, tags,
merge requests
,
external triggers
# - pipelines are triggered for merge requests
and
external triggers
(e.g. nightly build in dumux)
# - Within merge requests, we require to start the pipeline manually by clicking play for the trigger
# - Within merge requests, we require to start the pipeline manually by clicking play for the trigger
# - if the pipeline was triggered externally (from dumux), we expect the variable DUMUX_MERGE_REQUEST_BRANCH
# - if the pipeline was triggered externally (from dumux), we accept the variable DUMUX_MERGE_REQUEST_BRANCH
# and pass it to this project's test pipeline as DUMUX_BRANCH variable
.default-trigger
:
.default-trigger
:
stage
:
trigger pipelines
stage
:
trigger pipelines
trigger
:
trigger
:
...
@@ -21,7 +20,7 @@ variables:
...
@@ -21,7 +20,7 @@ variables:
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
when
:
manual
when
:
manual
variables
:
variables
:
DUMUX_BRANCH
:
$DUMUX_MERGE_REQUEST_BRANCH
DUMUX_
MR_
BRANCH
:
$DUMUX_MERGE_REQUEST_BRANCH
full-dune-2.7-gcc
:
full-dune-2.7-gcc
:
extends
:
.default-trigger
extends
:
.default-trigger
...
...
.gitlab-ci/default.yml
View file @
34294ef2
...
@@ -2,6 +2,7 @@ default:
...
@@ -2,6 +2,7 @@ default:
image
:
$IMAGE
image
:
$IMAGE
stages
:
stages
:
-
configure
-
build
-
build
-
test
-
test
...
@@ -9,31 +10,68 @@ workflow:
...
@@ -9,31 +10,68 @@ workflow:
rules
:
rules
:
-
if
:
$CI_PIPELINE_SOURCE=="parent_pipeline"
-
if
:
$CI_PIPELINE_SOURCE=="parent_pipeline"
build lecture
:
select tests
:
stage
:
build
stage
:
configure
before_script
:
before_script
:
-
|
-
|
if [ ! "${DUMUX_BRANCH}" ]; then
DUMUX_CLONE_BRANCH=master
DUMUX_BRANCH
=master;
if [[ -n "${
DUMUX_
MR_
BRANCH
}" ]]; then
else
DUMUX_CLONE_BRANCH=${DUMUX_MR_BRANCH}
echo "Received branch
name
${DUMUX_BRANCH}
from upstream
"
echo "Received
upstream merge request
branch ${DUMUX_
MR_
BRANCH}"
fi
fi
-
echo "Checking out branch ${DUMUX_BRANCH} in dumux"
-
echo "Checking out branch ${DUMUX_
CLONE_
BRANCH} in dumux"
-
git clone -b ${DUMUX_BRANCH} --depth 1 https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git
-
git clone -b ${DUMUX_
CLONE_
BRANCH} --depth 1 https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git
-
dunecontrol --opts=$DUNE_OPTS_FILE --only=dumux all
-
dunecontrol --opts=$DUNE_OPTS_FILE --only=dumux all
script
:
script
:
-
dunecontrol --opts=$DUNE_OPTS_FILE --current all
-
|
-
dunecontrol --opts=$DUNE_OPTS_FILE --current bexec make -k -j4 build_tests
dunecontrol --opts=$DUNE_OPTS_FILE --current all
if [[ -n "${DUMUX_MR_BRANCH}" ]]; then
python3 dumux/bin/testing/getchangedfiles.py -o changedfiles.txt -t origin/$DUMUX_MR_BRANCH
python3 dumux/bin/testing/findtests.py -o affectedtests.json --file-list changedfiles.txt
else
echo "Skipping test selection, build/test stages will consider all tests!"
echo "{}" >> affectedtests.json
fi
artifacts
:
paths
:
-
dumux
-
build-cmake
-
affectedtests.json
expire_in
:
3 hours
build lecture
:
stage
:
build
script
:
-
|
pushd build-cmake
make clean
if [[ -n "${DUMUX_MR_BRANCH}" ]]; then
python3 ../dumux/bin/testing/runselectedtests.py -c ../affectedtests.json -b
else
python3 ../dumux/bin/testing/runselectedtests.py --all -b
fi
popd
artifacts
:
artifacts
:
paths
:
paths
:
-
build-cmake
-
build-cmake
-
dumux
-
dumux
-
affectedtests.json
expire_in
:
3 hours
expire_in
:
3 hours
test lecture
:
test lecture
:
stage
:
test
stage
:
test
variables
:
OMPI_ALLOW_RUN_AS_ROOT
:
1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM
:
1
script
:
script
:
-
dunecontrol --opts=$DUNE_OPTS_FILE --current bexec dune-ctest -j4 --output-on-failure
-
|
pushd build-cmake
if [[ -n "${DUMUX_MR_BRANCH}" ]]; then
python3 ../dumux/bin/testing/runselectedtests.py -c ../affectedtests.json -t
else
python3 ../dumux/bin/testing/runselectedtests.py --all -t
fi
popd
needs
:
needs
:
-
job
:
build lecture
-
job
:
build lecture
artifacts
:
true
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