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
9e5b0739
Commit
9e5b0739
authored
Aug 09, 2021
by
Dennis Gläser
Browse files
[ci] avoid pipeline fail if dumux folder exists
parent
cc78c503
Pipeline
#7062
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci/default.yml
View file @
9e5b0739
...
...
@@ -13,6 +13,7 @@ workflow:
# variables that may be overwritten by the trigger
variables
:
DUMUX_REPO
:
"
https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git"
DUMUX_FOLDER
:
"
dumux"
MR_TARGET_BRANCH_NAME
:
"
"
DUMUX_MR_SOURCE_BRANCH
:
"
"
DUMUX_MR_TARGET_BRANCH
:
"
"
...
...
@@ -23,20 +24,21 @@ select tests:
stage
:
configure
before_script
:
-
|
if [ ! -d $DUMUX_FOLDER ]; then
git clone -b master --depth 1 $DUMUX_REPO $DUMUX_FOLDER
fi
if [[ -n "$DUMUX_MR_SOURCE_BRANCH" ]]; then
echo "Fetching upstream branches related to merge request."
echo "Source branch: $DUMUX_MR_SOURCE_BRANCH"
echo "Target branch: $DUMUX_MR_TARGET_BRANCH"
git clone -b ${DUMUX_MR_SOURCE_BRANCH} --depth 1 $DUMUX_REPO
pushd dumux
pushd $DUMUX_FOLDER
git fetch --depth=1 origin ${DUMUX_MR_TARGET_BRANCH}:${DUMUX_MR_TARGET_BRANCH}
popd
else
git clone -b master --depth 1 $DUMUX_REPO
pushd dumux
pushd $DUMUX_FOLDER
if [[ -n "$DUMUX_TRIGGER_COMMIT_SHA" ]]; then
echo "Fetching upstream commit $DUMUX_TRIGGER_COMMIT_SHA"
git fetch --depth=1 origin ${DUMUX_TRIGGER_COMMIT_SHA}
...
...
@@ -54,11 +56,11 @@ select tests:
-
dunecontrol --opts=$DUNE_OPTS_FILE --current all
-
|
if [[ -n "$DUMUX_MR_SOURCE_BRANCH" ]]; then
CHECK_FOLDER=
"dumux"
CHECK_FOLDER=
$DUMUX_FOLDER
SOURCE_TREE=$DUMUX_MR_SOURCE_BRANCH
TARGET_TREE=$DUMUX_MR_TARGET_BRANCH
elif [[ -n "$DUMUX_TRIGGER_REF_SHA" ]]; then
CHECK_FOLDER=
"dumux"
CHECK_FOLDER=
$DUMUX_FOLDER
SOURCE_TREE=$DUMUX_TRIGGER_COMMIT_SHA
TARGET_TREE=$DUMUX_TRIGGER_REF_SHA
elif [[ -n "$MR_TARGET_BRANCH_NAME" ]]; then
...
...
@@ -70,20 +72,20 @@ select tests:
if [[ -n "$SOURCE_TREE" ]]; then
echo "Detecting tests affected by changes in folder $CHECK_FOLDER,"
echo "using source/target trees: $SOURCE_TREE / $TARGET_TREE"
python3
dumux
/bin/testing/getchangedfiles.py --folder $CHECK_FOLDER \
--source-tree $SOURCE_TREE \
--target-tree $TARGET_TREE \
--outfile changedfiles.txt
python3
dumux
/bin/testing/findtests.py --outfile affectedtests.json \
--file-list changedfiles.txt \
--build-dir build-cmake
python3
$DUMUX_FOLDER
/bin/testing/getchangedfiles.py --folder $CHECK_FOLDER \
--source-tree $SOURCE_TREE \
--target-tree $TARGET_TREE \
--outfile changedfiles.txt
python3
$DUMUX_FOLDER
/bin/testing/findtests.py --outfile affectedtests.json \
--file-list changedfiles.txt \
--build-dir build-cmake
else
echo "Skipping test selection, build/test stages will consider all tests!"
touch affectedtests.json
fi
artifacts
:
paths
:
-
dumux
-
$DUMUX_FOLDER
-
build-cmake
-
affectedtests.json
expire_in
:
3 hours
...
...
@@ -95,15 +97,15 @@ build lecture:
pushd build-cmake
make clean
if [ -s ../affectedtests.json ]; then
python3 ../
dumux
/bin/testing/runselectedtests.py -c ../affectedtests.json -b
python3 ../
$DUMUX_FOLDER
/bin/testing/runselectedtests.py -c ../affectedtests.json -b
else
python3 ../
dumux
/bin/testing/runselectedtests.py --all -b
python3 ../
$DUMUX_FOLDER
/bin/testing/runselectedtests.py --all -b
fi
popd
artifacts
:
paths
:
-
build-cmake
-
dumux
-
$DUMUX_FOLDER
-
affectedtests.json
expire_in
:
3 hours
...
...
@@ -116,9 +118,9 @@ test lecture:
-
|
pushd build-cmake
if [ -s ../affectedtests.json ]; then
python3 ../
dumux
/bin/testing/runselectedtests.py -c ../affectedtests.json -t
python3 ../
$DUMUX_FOLDER
/bin/testing/runselectedtests.py -c ../affectedtests.json -t
else
python3 ../
dumux
/bin/testing/runselectedtests.py --all -t
python3 ../
$DUMUX_FOLDER
/bin/testing/runselectedtests.py --all -t
fi
popd
needs
:
...
...
Write
Preview
Markdown
is supported
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