Merge pull request #415 from akva2/jenkins_add_sca

add static analysis
This commit is contained in:
Arne Morten Kvarving
2025-12-18 14:25:41 +01:00
committed by GitHub
3 changed files with 45 additions and 8 deletions
+3
View File
@@ -12,3 +12,6 @@ To specify a given pull request to use for upstreams and downstreams,
trigger line needs to contain <module-name>=<pull request number>.
To build with downstreams the trigger line needs to contain 'with downstreams'.
**static_analysis.sh**:
Run static analysis for opm-upscaling
+11 -8
View File
@@ -18,14 +18,17 @@ declare -a downstreams
declare -A downstreamRev
# Clone opm-common
mkdir -p $WORKSPACE/deps/opm-common
pushd $WORKSPACE/deps/opm-common
git init .
git remote add origin https://github.com/OPM/opm-common
git fetch --depth 1 origin ${upstreamRev[opm-common]}:branch_to_build
test $? -eq 0 || exit 1
git checkout branch_to_build
popd
if ! test -d $WORKSPACE/deps/opm-common
then
mkdir -p $WORKSPACE/deps/opm-common
pushd $WORKSPACE/deps/opm-common
git init .
git remote add origin https://github.com/OPM/opm-common
git fetch --depth 1 origin ${upstreamRev[opm-common]}:branch_to_build
test $? -eq 0 || exit 1
git checkout branch_to_build
popd
fi
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
declare -a upstreams
upstreams=(opm-common
opm-grid)
declare -A upstreamRev
upstreamRev[opm-common]=master
upstreamRev[opm-grid]=master
if grep -q "opm-common=" <<< $ghprbCommentBody
then
upstreamRev[opm-common]=pull/`echo $ghprbCommentBody | sed -r 's/.*opm-common=([0-9]+).*/\1/g'`/merge
fi
# Clone opm-common
mkdir -p $WORKSPACE/deps/opm-common
pushd $WORKSPACE/deps/opm-common
git init .
git remote add origin https://github.com/OPM/opm-common
git fetch --depth 1 origin ${upstreamRev[opm-common]}:branch_to_build
test $? -eq 0 || exit 1
git checkout branch_to_build
popd
source ${TOOLCHAIN_DIR}/build-configurations-sca.sh
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh
$WORKSPACE/jenkins/build.sh
run_static_analysis opm-upscaling