Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
JenkinsConfiguration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
ChimeraTK Mirror
JenkinsConfiguration
Commits
9fe9ff38
Commit
9fe9ff38
authored
3 years ago
by
Jens Georg
Browse files
Options
Downloads
Patches
Plain Diff
cppcheck: Next try. Move to debug build step
parent
491a019c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vars/helper.groovy
+33
-10
33 additions, 10 deletions
vars/helper.groovy
with
33 additions
and
10 deletions
vars/helper.groovy
+
33
−
10
View file @
9fe9ff38
...
...
@@ -77,6 +77,11 @@ def doAnalysis(String label, String buildType) {
doPrepare
(
false
)
doBuilddirArtefact
(
label
,
buildType
)
// Run cppcheck only for focal-debug
if
((!
env
.
DISABLE_CPPCHECK
||
env
.
DISABLE_CPPCHECK
==
''
)
&&
label
==
'focal'
)
{
doCppcheck
(
label
,
buildType
)
}
// Add inactivity timeout of 60 minutes (build will be interrupted if 60 minutes no log output has been produced)
timeout
(
activity:
true
,
time:
60
)
{
...
...
@@ -455,16 +460,8 @@ def doPublishBuildTestDeploy(ArrayList<String> builds) {
// Run cppcheck and publish the result. Since this is a static analysis, we don't have to run it for each label
if
(!
env
.
DISABLE_CPPCHECK
||
env
.
DISABLE_CPPCHECK
==
''
)
{
sh
"""
pwd
mkdir -p build
if [ -e compile_commands.json ]; then
cppcheck --enable=all --xml --xml-version=2 --project=compile_commands.json 2> ./build/cppcheck.xml
else
cppcheck --enable=all --xml --xml-version=2 -ibuild -Iinclude . 2> ./build/cppcheck.xml
fi
"""
publishCppcheck
pattern:
'build/cppcheck.xml'
unstash
"cppcheck.xml"
publishCppcheck
pattern:
'cppcheck.xml'
}
// Scan for compiler warnings. This is scanning the entire build logs for all labels and build types
...
...
@@ -532,3 +529,29 @@ def doPublishAnalysis(ArrayList<String> builds) {
/**********************************************************************************************************************/
def
doCppcheck
(
String
label
,
String
buildType
)
{
def
parentJob
=
env
.
JOB_NAME
[
0
..-
10
]
// remove "-analysis" from the job name, which is 9 chars long
// Generate coverage report as HTML and also convert it into cobertura XML file
sh
"""
chown msk_jenkins -R /scratch
cat > /scratch/script <<EOF
#!/bin/bash
cd /scratch/build-${parentJob}
for VAR in \${JOB_VARIABLES} \${TEST_VARIABLES}; do
export \\`eval echo \\\${VAR}\\`
done
if [ -e compile_commands.json ]; then
cppcheck --inline-suppr --enable=all --xml --xml-version=2 --project=compile_commands.json 2>cppcheck.xml
else
cppcheck --inline-suppr --enable=all --xml --xml-version=2 -ibuild -Iinclude /scratch/source 2>cppcheck.xml
fi
cp cppcheck.xml ${WORKSPACE} || true
EOF
cat /scratch/script
chmod +x /scratch/script
sudo -H -E -u msk_jenkins /scratch/script
"""
stash
allowEmpty:
true
,
includes:
"cppcheck.xml"
,
name:
"cppcheck.xml"
}
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