Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Computing
cbmroot
Commits
e296f4e9
Commit
e296f4e9
authored
4 years ago
by
Pierre-Alain Loizeau
Browse files
Options
Downloads
Patches
Plain Diff
Add linear history check to CI for merge requests. Refs #1852
parent
4b0967d0
No related branches found
No related tags found
1 merge request
!115
Add linear history check to CI for merge requests. Refs #1852
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+34
-7
34 additions, 7 deletions
.gitlab-ci.yml
with
34 additions
and
7 deletions
.gitlab-ci.yml
+
34
−
7
View file @
e296f4e9
stages
:
stages
:
-
checkRe
base
-
checkRe
pository
-
checkFormat
-
checkFormat
-
build
-
build
-
documentation
-
documentation
RebaseCheck
:
RebaseCheck
:
stage
:
checkRe
base
stage
:
checkRe
pository
tags
:
tags
:
-
CbmRoot
-
CbmRoot
only
:
only
:
...
@@ -15,7 +15,7 @@ RebaseCheck:
...
@@ -15,7 +15,7 @@ RebaseCheck:
-
$CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
-
$CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
script
:
script
:
# Get the upstream repository manually. I did not find any other way to have it for
# Get the upstream repository manually. I did not find any other way to have it for
# comparis
s
on
# comparison
# Check if a rebase is needed
# Check if a rebase is needed
# If a rebase is needed stop immediately
# If a rebase is needed stop immediately
-
scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
-
scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
...
@@ -33,6 +33,33 @@ RebaseCheck:
...
@@ -33,6 +33,33 @@ RebaseCheck:
-
exit
1
-
exit
1
-
fi
-
fi
LinearHistCheck
:
stage
:
checkRepository
tags
:
-
CbmRoot
only
:
refs
:
-
merge_requests
variables
:
-
$CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
script
:
# Get the upstream repository manually. I did not find any other way to have it for
# comparison
# Check if the history introduced by the MR is linear (no branch loop in fork)
# If not linear stop immediately
-
scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
-
git fetch upstream
-
count=$(git rev-list --min-parents=2 --count upstream/master..HEAD)
-
echo "${count}"
-
if [ 0 = "${count}" ]; then
-
echo "History introduced in fork is linear"
-
exit
0
-
else
-
echo "History introduced in fork is not linear"
-
echo "${count} merge commits must be removed or the other new commits have to be replayed in a new branch"
-
exit
1
-
fi
FormatCheck
:
FormatCheck
:
stage
:
checkFormat
stage
:
checkFormat
tags
:
tags
:
...
@@ -44,7 +71,7 @@ FormatCheck:
...
@@ -44,7 +71,7 @@ FormatCheck:
-
$CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
-
$CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
script
:
script
:
# Get the upstream repository manually. I did not find any other way to have it for
# Get the upstream repository manually. I did not find any other way to have it for
# comparis
s
on
# comparison
-
scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
-
scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
-
git fetch upstream
-
git fetch upstream
-
echo "export FAIRSOFT_VERSION=jun19p1" > env.sh
-
echo "export FAIRSOFT_VERSION=jun19p1" > env.sh
...
@@ -58,7 +85,7 @@ FormatCheck:
...
@@ -58,7 +85,7 @@ FormatCheck:
-
echo "export FAIRROOT_FORMAT_BASE=upstream/\${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}" >> env.sh
-
echo "export FAIRROOT_FORMAT_BASE=upstream/\${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}" >> env.sh
-
. ./env.sh && ctest -S cmake/scripts/checkformat.cmake -VV
-
. ./env.sh && ctest -S cmake/scripts/checkformat.cmake -VV
CbmRoot_Continuous
:
CbmRoot_Continuous
:
stage
:
build
stage
:
build
tags
:
tags
:
...
@@ -90,7 +117,7 @@ CbmRoot_Continuous:
...
@@ -90,7 +117,7 @@ CbmRoot_Continuous:
# - parameters
# - parameters
script
:
script
:
-
set -xv
-
set -xv
-
mkdir -p build
-
mkdir -p build
-
cd build
-
cd build
# - find . -name "*.root" -delete
# - find . -name "*.root" -delete
# - find . -name "*_ok" -delete
# - find . -name "*_ok" -delete
...
@@ -139,7 +166,7 @@ CbmRoot_Merge:
...
@@ -139,7 +166,7 @@ CbmRoot_Merge:
-
echo "export FAIRSOFT_VERSION=jun19p1" >> Dart.cfg
-
echo "export FAIRSOFT_VERSION=jun19p1" >> Dart.cfg
-
echo "export FAIRROOT_VERSION=v18.2.0" >> Dart.cfg
-
echo "export FAIRROOT_VERSION=v18.2.0" >> Dart.cfg
-
echo "export SIMPATH=/cvmfs/fairroot.gsi.de/fairsoft/\${FAIRSOFT_VERSION}" >> Dart.cfg
-
echo "export SIMPATH=/cvmfs/fairroot.gsi.de/fairsoft/\${FAIRSOFT_VERSION}" >> Dart.cfg
-
echo "export FAIRROOTPATH=/cvmfs/fairroot.gsi.de/fairroot/\${FAIRROOT_VERSION}_fairsoft-\${FAIRSOFT_VERSION}" >> Dart.cfg
-
echo "export FAIRROOTPATH=/cvmfs/fairroot.gsi.de/fairroot/\${FAIRROOT_VERSION}_fairsoft-\${FAIRSOFT_VERSION}" >> Dart.cfg
-
echo "export BUILDDIR=$PWD/build" >> Dart.cfg
-
echo "export BUILDDIR=$PWD/build" >> Dart.cfg
-
echo "export SOURCEDIR=$PWD" >> Dart.cfg
-
echo "export SOURCEDIR=$PWD" >> Dart.cfg
-
echo "export NCPU=5" >> Dart.cfg
-
echo "export NCPU=5" >> Dart.cfg
...
...
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