Xinyu Zhang | 59f7fee | 2021-05-21 14:04:11 +0800 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Xinyu Zhang | a16c5e8 | 2022-06-13 11:08:18 +0800 | [diff] [blame] | 2 | # Copyright (c) 2020-2022, Arm Limited. All rights reserved. |
Xinyu Zhang | 59f7fee | 2021-05-21 14:04:11 +0800 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
Leonardo Sandoval | 472f5d8 | 2020-11-30 11:24:13 -0600 | [diff] [blame] | 8 | - scm: |
| 9 | name: tf-m-ci-scripts |
| 10 | scm: |
| 11 | - git: |
| 12 | url: https://git.trustedfirmware.org/ci/tf-m-ci-scripts.git |
| 13 | refspec: +refs/heads/master:refs/remotes/origin/master |
| 14 | name: origin |
| 15 | branches: |
| 16 | - refs/heads/master |
| 17 | basedir: tf-m-ci-scripts |
| 18 | skip-tag: true |
| 19 | shallow-clone: true |
| 20 | wipe-workspace: false |
| 21 | - scm: |
| 22 | name: trusted-firmware-m |
| 23 | scm: |
| 24 | - git: |
| 25 | url: https://review.trustedfirmware.org/${TF_GERRIT_PROJECT} |
| 26 | refspec: ${TF_GERRIT_REFSPEC} |
| 27 | name: origin |
| 28 | branches: |
| 29 | - ${TF_GERRIT_BRANCH} |
| 30 | basedir: trusted-firmware-m |
| 31 | skip-tag: true |
| 32 | shallow-clone: false |
| 33 | wipe-workspace: false |
| 34 | - job: |
| 35 | name: tf-m-coverity |
| 36 | node: docker-amd64-tf-m-bionic |
| 37 | project-type: freestyle |
| 38 | concurrent: true |
| 39 | disabled: false |
| 40 | defaults: global |
| 41 | description: | |
| 42 | Run the Coverity tool on Trusted Firmware M and submit the resulting |
| 43 | tarball to <a href="https://scan.coverity.com/projects/trusted-firmware-m-35b064f0-65c2-4afb-9ba9-24aa432fb7fa">Coverity Scan Online</a>. |
| 44 | <br/> |
| 45 | This job runs <b>every weekday</b> and by default uses the <b>master</b> branch on trustedfirmware.org. |
| 46 | properties: |
| 47 | - build-discarder: |
| 48 | days-to-keep: 180 |
| 49 | num-to-keep: 180 |
Leonardo Sandoval | 472f5d8 | 2020-11-30 11:24:13 -0600 | [diff] [blame] | 50 | parameters: |
| 51 | - string: |
| 52 | name: TF_GERRIT_PROJECT |
| 53 | default: 'TF-M/trusted-firmware-m' |
| 54 | - string: |
| 55 | name: TF_GERRIT_BRANCH |
| 56 | default: 'refs/heads/master' |
| 57 | - string: |
| 58 | name: TF_GERRIT_REFSPEC |
| 59 | default: '+refs/heads/master:refs/remotes/origin/master' |
Leonardo Sandoval | ec4d500 | 2021-02-03 16:14:45 -0600 | [diff] [blame] | 60 | - string: |
| 61 | name: COVERITY_VERSION |
| 62 | default: '2020.09' |
Leonardo Sandoval | 472f5d8 | 2020-11-30 11:24:13 -0600 | [diff] [blame] | 63 | - bool: |
| 64 | name: UPLOAD_TO_COVERITY_SCAN_ONLINE |
Leonardo Sandoval | b20632f | 2021-03-12 09:11:37 -0600 | [diff] [blame] | 65 | default: true |
Leonardo Sandoval | 472f5d8 | 2020-11-30 11:24:13 -0600 | [diff] [blame] | 66 | scm: |
| 67 | - tf-m-ci-scripts |
| 68 | - trusted-firmware-m |
| 69 | wrappers: |
| 70 | - timestamps |
| 71 | - credentials-binding: |
| 72 | - text: |
| 73 | credential-id: TF-M-COVERITY-SCAN-TOKEN |
| 74 | variable: TF_M_COVERITY_SCAN_TOKEN |
| 75 | builders: |
| 76 | - shell: |- |
| 77 | #!/bin/bash |
| 78 | set -e |
| 79 | |
| 80 | # Fetch coverity tool and untar it |
Leonardo Sandoval | 472f5d8 | 2020-11-30 11:24:13 -0600 | [diff] [blame] | 81 | cd ${WORKSPACE} |
| 82 | wget https://scan.coverity.com/download/linux64 \ |
| 83 | --quiet \ |
| 84 | --post-data "token=${TF_M_COVERITY_SCAN_TOKEN}&project=Trusted+Firmware-M" \ |
| 85 | -O coverity_tool.tgz |
| 86 | tar -xzf coverity_tool.tgz |
| 87 | mv cov-analysis-linux64-${COVERITY_VERSION} coverity |
| 88 | export PATH=${WORKSPACE}/coverity/bin:${PATH} |
| 89 | |
| 90 | # Run coverity |
| 91 | cd ${WORKSPACE}/trusted-firmware-m |
| 92 | ${WORKSPACE}/tf-m-ci-scripts/run-coverity.py --tf $(pwd) |
| 93 | |
| 94 | - conditional-step: |
| 95 | condition-kind: boolean-expression |
| 96 | condition-expression: "${UPLOAD_TO_COVERITY_SCAN_ONLINE}" |
| 97 | on-evaluation-failure: dont-run |
| 98 | steps: |
| 99 | - shell: |- |
| 100 | #!/bin/bash |
| 101 | |
| 102 | echo "Uploading tarball to Coverity Scan Online..." |
| 103 | cd ${WORKSPACE}/trusted-firmware-m |
| 104 | GIT_COMMIT=$(git rev-parse HEAD) |
| 105 | |
| 106 | curl \ |
| 107 | --form token=${TF_M_COVERITY_SCAN_TOKEN} \ |
| 108 | --form email=Karl.Zhang@arm.com \ |
| 109 | --form file=@"arm-tf-coverity-results.tgz" \ |
| 110 | --form version="Commit ${GIT_COMMIT}" \ |
| 111 | --form description="Build ${BUILD_DISPLAY_NAME}" \ |
| 112 | https://scan.coverity.com/builds?project=Trusted+Firmware-M |
| 113 | triggers: |
| 114 | - timed: H H(4-6) * * 1-5 |