Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 1 | - job: |
Leonardo Sandoval | ffaee98 | 2021-11-11 10:27:57 -0600 | [diff] [blame] | 2 | name: tf-a-coverity |
Govindraj Raja | 631a6ae | 2023-06-06 15:09:29 -0500 | [diff] [blame^] | 3 | node: docker-amd64-tf-a-jammy |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 4 | 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: |
| 14 | - build-discarder: |
Leonardo Sandoval | a4feb55 | 2021-03-02 12:10:21 -0600 | [diff] [blame] | 15 | days-to-keep: 14 |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 16 | - authorization: |
Leonardo Sandoval | ebca882 | 2021-01-25 18:20:04 -0600 | [diff] [blame] | 17 | !include: authorization.yaml.inc |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 18 | parameters: |
| 19 | - string: |
| 20 | name: TF_GERRIT_PROJECT |
| 21 | default: 'TF-A/trusted-firmware-a' |
| 22 | - string: |
| 23 | name: TF_GERRIT_BRANCH |
| 24 | default: 'refs/heads/integration' |
| 25 | - string: |
| 26 | name: TF_GERRIT_REFSPEC |
| 27 | default: '+refs/heads/integration:refs/remotes/origin/integration' |
Leonardo Sandoval | 7e95c66 | 2021-02-03 12:54:51 -0600 | [diff] [blame] | 28 | - string: |
Zelalem Aweke | e8801df | 2021-10-25 13:41:44 -0500 | [diff] [blame] | 29 | name: CI_REFSPEC |
| 30 | default: '+refs/heads/master:refs/remotes/origin/master' |
| 31 | - string: |
Leonardo Sandoval | 7e95c66 | 2021-02-03 12:54:51 -0600 | [diff] [blame] | 32 | name: COVERITY_VERSION |
Sandrine Bailleux | 990f2d9 | 2022-09-05 15:12:27 +0200 | [diff] [blame] | 33 | default: '2022.6.0' |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 34 | - bool: |
| 35 | name: UPLOAD_TO_COVERITY_SCAN_ONLINE |
Sandrine Bailleux | 55e282f | 2022-11-23 08:18:27 +0100 | [diff] [blame] | 36 | default: true |
| 37 | description: |- |
| 38 | Whether the resulting tarball should be automatically uploaded to Coverity Scan Online. |
| 39 | <p> |
| 40 | <b style="color:red;">The number of uploads allowed on Coverity Scan Online is LIMITED. |
| 41 | Therefore, if you don't need the results to be analysed, please UNTICK this box!<b> |
Leonardo Sandoval | d1b6b5a | 2021-09-13 12:06:26 -0500 | [diff] [blame] | 42 | - string: |
| 43 | name: SHARE_FOLDER |
| 44 | default: '/srv/shared/${JOB_NAME}/${BUILD_NUMBER}' |
| 45 | description: 'Folder containing shared repositories for downstream pipeline jobs' |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 46 | wrappers: |
| 47 | - timestamps |
| 48 | - credentials-binding: |
| 49 | - text: |
| 50 | credential-id: TF-COVERITY-SCAN-TOKEN |
| 51 | variable: TF_COVERITY_SCAN_TOKEN |
| 52 | builders: |
Leonardo Sandoval | d1b6b5a | 2021-09-13 12:06:26 -0500 | [diff] [blame] | 53 | - shell: |
| 54 | !include-raw: scripts/clone.sh |
Fathi Boudra | 9c8a945 | 2020-12-08 22:16:57 +0100 | [diff] [blame] | 55 | - shell: | |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 56 | #!/bin/bash |
Leonardo Sandoval | f950b64 | 2020-12-03 21:41:54 -0600 | [diff] [blame] | 57 | set -e |
Sandrine Bailleux | 0330cc4 | 2022-12-05 11:45:20 +0100 | [diff] [blame] | 58 | set -x |
Sandrine Bailleux | 1b636c9 | 2022-11-22 11:01:28 +0100 | [diff] [blame] | 59 | |
Leonardo Sandoval | f950b64 | 2020-12-03 21:41:54 -0600 | [diff] [blame] | 60 | # Install crypto library |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 61 | CRYPTOCELL_LIB_PATH=/arm/projectscratch/ssg/trusted-fw |
| 62 | mkdir -p ${CRYPTOCELL_LIB_PATH} |
| 63 | cd ${CRYPTOCELL_LIB_PATH} |
| 64 | curl --connect-timeout 5 --retry 5 --retry-delay 1 \ |
| 65 | -sLSO -C - https://downloads.trustedfirmware.org/tf-a/dummy-crypto-lib.tar |
| 66 | tar xf dummy-crypto-lib.tar |
Sandrine Bailleux | 1b636c9 | 2022-11-22 11:01:28 +0100 | [diff] [blame] | 67 | |
Leonardo Sandoval | f950b64 | 2020-12-03 21:41:54 -0600 | [diff] [blame] | 68 | # Fetch coverity tool and untar it |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 69 | cd ${WORKSPACE} |
Sandrine Bailleux | 5dbbe59 | 2022-12-05 14:41:44 +0100 | [diff] [blame] | 70 | wget https://downloads.trustedfirmware.org/tf-a/tf-a-coverity/coverity_tool.tgz |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 71 | tar -xzf coverity_tool.tgz |
| 72 | mv cov-analysis-linux64-${COVERITY_VERSION} coverity |
| 73 | export PATH=${WORKSPACE}/coverity/bin:${PATH} |
Sandrine Bailleux | 1b636c9 | 2022-11-22 11:01:28 +0100 | [diff] [blame] | 74 | |
Leonardo Sandoval | f950b64 | 2020-12-03 21:41:54 -0600 | [diff] [blame] | 75 | # Run coverity |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 76 | cd ${WORKSPACE}/trusted-firmware-a |
| 77 | ${WORKSPACE}/tf-a-ci-scripts/script/tf-coverity/run_coverity_on_tf.py --tf $(pwd) |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 78 | - conditional-step: |
| 79 | condition-kind: boolean-expression |
| 80 | condition-expression: "${UPLOAD_TO_COVERITY_SCAN_ONLINE}" |
| 81 | on-evaluation-failure: dont-run |
| 82 | steps: |
Fathi Boudra | 9c8a945 | 2020-12-08 22:16:57 +0100 | [diff] [blame] | 83 | - shell: | |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 84 | #!/bin/bash |
Sandrine Bailleux | 1b636c9 | 2022-11-22 11:01:28 +0100 | [diff] [blame] | 85 | set -e |
| 86 | |
| 87 | cd ${WORKSPACE}/trusted-firmware-a |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 88 | GIT_COMMIT=$(git rev-parse HEAD) |
Sandrine Bailleux | 1b636c9 | 2022-11-22 11:01:28 +0100 | [diff] [blame] | 89 | |
| 90 | echo "Uploading tarball to Coverity Scan Online..." |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 91 | curl \ |
Sandrine Bailleux | 1b636c9 | 2022-11-22 11:01:28 +0100 | [diff] [blame] | 92 | --form token="${TF_COVERITY_SCAN_TOKEN}" \ |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 93 | --form email=sandrine.bailleux@arm.com \ |
| 94 | --form file=@"arm-tf-coverity-results.tgz" \ |
Sandrine Bailleux | 1b636c9 | 2022-11-22 11:01:28 +0100 | [diff] [blame] | 95 | --form version="Commit ${GIT_COMMIT}" \ |
| 96 | --form description="Build ${BUILD_DISPLAY_NAME}" \ |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 97 | https://scan.coverity.com/builds?project=ARM-software%2Farm-trusted-firmware |
Leonardo Sandoval | 81c17c6 | 2021-01-14 16:31:28 -0600 | [diff] [blame] | 98 | publishers: |
| 99 | - archive: |
| 100 | artifacts: 'trusted-firmware-a/arm-tf-coverity-results.tgz, trusted-firmware-a/tf_coverage.log' |
Fathi Boudra | 8aa4bd8 | 2021-01-15 10:30:57 +0100 | [diff] [blame] | 101 | - groovy-postbuild: |
| 102 | script: |
| 103 | !include-raw: |
Leonardo Sandoval | ffaee98 | 2021-11-11 10:27:57 -0600 | [diff] [blame] | 104 | - tf-a-coverity/postbuild.groovy |
Paul Sokolovsky | 8299ace | 2023-01-07 12:27:40 +0300 | [diff] [blame] | 105 | - email: |
| 106 | recipients: 'paul.sokolovsky@linaro.org' |