Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 1 | - scm: |
| 2 | name: tf-a-ci-scripts |
| 3 | scm: |
| 4 | - git: |
| 5 | url: https://git.trustedfirmware.org/ci/tf-a-ci-scripts.git |
| 6 | refspec: +refs/heads/master:refs/remotes/origin/master |
| 7 | name: origin |
| 8 | branches: |
| 9 | - refs/heads/master |
| 10 | basedir: tf-a-ci-scripts |
| 11 | skip-tag: true |
| 12 | shallow-clone: true |
| 13 | wipe-workspace: false |
| 14 | - scm: |
| 15 | name: trusted-firmware-a |
| 16 | scm: |
| 17 | - git: |
| 18 | url: https://review.trustedfirmware.org/${TF_GERRIT_PROJECT} |
| 19 | refspec: ${TF_GERRIT_REFSPEC} |
| 20 | name: origin |
| 21 | branches: |
| 22 | - ${TF_GERRIT_BRANCH} |
| 23 | basedir: trusted-firmware-a |
| 24 | skip-tag: true |
| 25 | shallow-clone: false |
| 26 | wipe-workspace: false |
| 27 | - job: |
| 28 | name: tf-coverity |
| 29 | node: docker-amd64-tf-a-bionic |
| 30 | project-type: freestyle |
| 31 | concurrent: true |
| 32 | disabled: false |
| 33 | defaults: global |
| 34 | description: | |
| 35 | Run the Coverity tool on Trusted Firmware and submit the resulting |
| 36 | tarball to <a href="https://scan.coverity.com/projects/arm-software-arm-trusted-firmware">Coverity Scan Online</a>. |
| 37 | <br/> |
| 38 | This job runs <b>every weekday</b> and by default uses the <b>integration</b> branch on trustedfirmware.org. |
| 39 | properties: |
| 40 | - build-discarder: |
Leonardo Sandoval | 81c17c6 | 2021-01-14 16:31:28 -0600 | [diff] [blame^] | 41 | days-to-keep: 7 |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 42 | - authorization: |
| 43 | anonymous: |
| 44 | - job-discover |
| 45 | - job-read |
| 46 | - job-extended-read |
| 47 | - job-workspace |
| 48 | lsandov1: |
| 49 | - job-read |
| 50 | - job-extended-read |
| 51 | - job-build |
| 52 | - job-cancel |
| 53 | - run-update |
| 54 | parameters: |
| 55 | - string: |
| 56 | name: TF_GERRIT_PROJECT |
| 57 | default: 'TF-A/trusted-firmware-a' |
| 58 | - string: |
| 59 | name: TF_GERRIT_BRANCH |
| 60 | default: 'refs/heads/integration' |
| 61 | - string: |
| 62 | name: TF_GERRIT_REFSPEC |
| 63 | default: '+refs/heads/integration:refs/remotes/origin/integration' |
| 64 | - bool: |
| 65 | name: UPLOAD_TO_COVERITY_SCAN_ONLINE |
| 66 | default: false |
| 67 | scm: |
| 68 | - tf-a-ci-scripts |
| 69 | - trusted-firmware-a |
| 70 | wrappers: |
| 71 | - timestamps |
| 72 | - credentials-binding: |
| 73 | - text: |
| 74 | credential-id: TF-COVERITY-SCAN-TOKEN |
| 75 | variable: TF_COVERITY_SCAN_TOKEN |
| 76 | builders: |
Fathi Boudra | 9c8a945 | 2020-12-08 22:16:57 +0100 | [diff] [blame] | 77 | - shell: | |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 78 | #!/bin/bash |
Fathi Boudra | 9c8a945 | 2020-12-08 22:16:57 +0100 | [diff] [blame] | 79 | |
Leonardo Sandoval | f950b64 | 2020-12-03 21:41:54 -0600 | [diff] [blame] | 80 | set -e |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 81 | |
Leonardo Sandoval | f950b64 | 2020-12-03 21:41:54 -0600 | [diff] [blame] | 82 | # Install crypto library |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 83 | CRYPTOCELL_LIB_PATH=/arm/projectscratch/ssg/trusted-fw |
| 84 | mkdir -p ${CRYPTOCELL_LIB_PATH} |
| 85 | cd ${CRYPTOCELL_LIB_PATH} |
| 86 | curl --connect-timeout 5 --retry 5 --retry-delay 1 \ |
| 87 | -sLSO -C - https://downloads.trustedfirmware.org/tf-a/dummy-crypto-lib.tar |
| 88 | tar xf dummy-crypto-lib.tar |
| 89 | |
Leonardo Sandoval | f950b64 | 2020-12-03 21:41:54 -0600 | [diff] [blame] | 90 | # Fetch coverity tool and untar it |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 91 | COVERITY_VERSION=2019.03 |
| 92 | cd ${WORKSPACE} |
| 93 | wget https://scan.coverity.com/download/linux64 \ |
| 94 | --quiet \ |
| 95 | --post-data "token=${TF_COVERITY_SCAN_TOKEN}&project=ARM-software%2Farm-trusted-firmware" \ |
| 96 | -O coverity_tool.tgz |
| 97 | tar -xzf coverity_tool.tgz |
| 98 | mv cov-analysis-linux64-${COVERITY_VERSION} coverity |
| 99 | export PATH=${WORKSPACE}/coverity/bin:${PATH} |
| 100 | |
Leonardo Sandoval | f950b64 | 2020-12-03 21:41:54 -0600 | [diff] [blame] | 101 | # Run coverity |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 102 | cd ${WORKSPACE}/trusted-firmware-a |
| 103 | ${WORKSPACE}/tf-a-ci-scripts/script/tf-coverity/run_coverity_on_tf.py --tf $(pwd) |
| 104 | |
| 105 | - conditional-step: |
| 106 | condition-kind: boolean-expression |
| 107 | condition-expression: "${UPLOAD_TO_COVERITY_SCAN_ONLINE}" |
| 108 | on-evaluation-failure: dont-run |
| 109 | steps: |
Fathi Boudra | 9c8a945 | 2020-12-08 22:16:57 +0100 | [diff] [blame] | 110 | - shell: | |
Leonardo Sandoval | 37ce1aa | 2020-10-16 16:56:16 -0500 | [diff] [blame] | 111 | #!/bin/bash |
| 112 | |
| 113 | echo "Uploading tarball to Coverity Scan Online..." |
| 114 | GIT_COMMIT=$(git rev-parse HEAD) |
| 115 | |
| 116 | curl \ |
| 117 | --form token=${{TF_COVERITY_SCAN_TOKEN}} \ |
| 118 | --form email=sandrine.bailleux@arm.com \ |
| 119 | --form file=@"arm-tf-coverity-results.tgz" \ |
| 120 | --form version="Commit ${{GIT_COMMIT}}" \ |
| 121 | --form description="Build ${{BUILD_DISPLAY_NAME}}" \ |
| 122 | https://scan.coverity.com/builds?project=ARM-software%2Farm-trusted-firmware |
| 123 | triggers: |
Leonardo Sandoval | 81c17c6 | 2021-01-14 16:31:28 -0600 | [diff] [blame^] | 124 | - timed: H H(4-6) * * 1-5 |
| 125 | publishers: |
| 126 | - archive: |
| 127 | artifacts: 'trusted-firmware-a/arm-tf-coverity-results.tgz, trusted-firmware-a/tf_coverage.log' |