blob: 774562d63bbf609d78b825071ef70e4b193d7743 [file] [log] [blame]
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -05001- job:
Leonardo Sandovalffaee982021-11-11 10:27:57 -06002 name: tf-a-coverity
Chris Kaya86a3812025-07-11 17:56:10 +01003 node: docker-amd64-tf-a-jammy-high-spec
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -05004 project-type: freestyle
5 concurrent: true
6 disabled: false
7 defaults: global
8 description: |
9 Run the Coverity tool on Trusted Firmware and submit the resulting
10 tarball to <a href="https://scan.coverity.com/projects/arm-software-arm-trusted-firmware">Coverity Scan Online</a>.
11 <br/>
12 This job runs <b>every weekday</b> and by default uses the <b>integration</b> branch on trustedfirmware.org.
13 properties:
Chris Kay675db4f2025-06-24 14:14:34 +010014 - build-discarder:
15 days-to-keep: 14
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050016 parameters:
Chris Kay675db4f2025-06-24 14:14:34 +010017 - string:
18 name: TF_GERRIT_PROJECT
19 default: TF-A/trusted-firmware-a
20 - string:
21 name: TF_GERRIT_BRANCH
22 default: refs/heads/integration
23 - string:
24 name: TF_GERRIT_REFSPEC
25 default: +refs/heads/integration:refs/remotes/origin/integration
26 - string:
27 name: CI_REFSPEC
28 default: +refs/heads/master:refs/remotes/origin/master
29 - string:
30 name: JOBS_REFSPEC
31 default: refs/heads/master
32 description: |
33 tf-a-job-configs refspec to use. The master branch is used by default.
34 - string:
35 name: COVERITY_VERSION
36 default: 2024.6.1
37 - bool:
38 name: UPLOAD_TO_COVERITY_SCAN_ONLINE
39 default: true
40 description: |-
41 Whether the resulting tarball should be automatically uploaded to Coverity Scan Online.
42 <p>
43 <b style="color:red;">The number of uploads allowed on Coverity Scan Online is LIMITED.
44 Therefore, if you don't need the results to be analysed, please UNTICK this box!<b>
45 - string:
46 name: SHARE_FOLDER
47 default: /srv/shared/${JOB_NAME}/${BUILD_NUMBER}
48 description: Folder containing shared repositories for downstream pipeline jobs
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050049 wrappers:
Chris Kay675db4f2025-06-24 14:14:34 +010050 - timestamps
51 - credentials-binding:
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050052 - text:
53 credential-id: TF-COVERITY-SCAN-TOKEN
54 variable: TF_COVERITY_SCAN_TOKEN
55 builders:
Chris Kay675db4f2025-06-24 14:14:34 +010056 - shell: !include-raw: scripts/clone.sh
57 - shell: |
58 #!/bin/bash
59 set -e
60 set -x
Sandrine Bailleux1b636c92022-11-22 11:01:28 +010061
Chris Kay675db4f2025-06-24 14:14:34 +010062 # Fetch coverity tool and untar it
63 cd ${WORKSPACE}
64 wget ${DOWNLOAD_SERVER_URL}/tf-a/tf-a-coverity/coverity_tool.tgz
65 tar -xzf coverity_tool.tgz
66 mv cov-analysis-linux64-${COVERITY_VERSION} coverity
67 export PATH=${WORKSPACE}/coverity/bin:${PATH}
Sandrine Bailleux1b636c92022-11-22 11:01:28 +010068
Chris Kay675db4f2025-06-24 14:14:34 +010069 # Run coverity
70 cd ${WORKSPACE}/trusted-firmware-a
71 ${WORKSPACE}/tf-a-ci-scripts/script/tf-coverity/run_coverity_on_tf.py --tf $(pwd)
72 - conditional-step:
73 condition-kind: boolean-expression
74 condition-expression: ${UPLOAD_TO_COVERITY_SCAN_ONLINE}
75 on-evaluation-failure: dont-run
76 steps:
Fathi Boudra9c8a9452020-12-08 22:16:57 +010077 - shell: |
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050078 #!/bin/bash
Sandrine Bailleux1b636c92022-11-22 11:01:28 +010079 set -e
80
81 cd ${WORKSPACE}/trusted-firmware-a
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050082 GIT_COMMIT=$(git rev-parse HEAD)
Sandrine Bailleux1b636c92022-11-22 11:01:28 +010083
84 echo "Uploading tarball to Coverity Scan Online..."
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050085 curl \
Sandrine Bailleux1b636c92022-11-22 11:01:28 +010086 --form token="${TF_COVERITY_SCAN_TOKEN}" \
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050087 --form email=sandrine.bailleux@arm.com \
88 --form file=@"arm-tf-coverity-results.tgz" \
Sandrine Bailleux1b636c92022-11-22 11:01:28 +010089 --form version="Commit ${GIT_COMMIT}" \
90 --form description="Build ${BUILD_DISPLAY_NAME}" \
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050091 https://scan.coverity.com/builds?project=ARM-software%2Farm-trusted-firmware
Leonardo Sandoval81c17c62021-01-14 16:31:28 -060092 publishers:
Chris Kay675db4f2025-06-24 14:14:34 +010093 - archive:
94 artifacts: trusted-firmware-a/arm-tf-coverity-results.tgz, trusted-firmware-a/tf_coverage.log
95 - groovy-postbuild:
96 script: !include-raw:
97 - tf-a-coverity/postbuild.groovy