blob: 03d308d5c5c4b55a5a120eb8540511d9510db614 [file] [log] [blame]
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -05001- 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
Leonardo Sandoval94abc042021-03-29 19:32:39 -060024 choosing-strategy: gerrit
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050025 skip-tag: true
26 shallow-clone: false
27 wipe-workspace: false
28- job:
29 name: tf-coverity
30 node: docker-amd64-tf-a-bionic
31 project-type: freestyle
32 concurrent: true
33 disabled: false
34 defaults: global
35 description: |
36 Run the Coverity tool on Trusted Firmware and submit the resulting
37 tarball to <a href="https://scan.coverity.com/projects/arm-software-arm-trusted-firmware">Coverity Scan Online</a>.
38 <br/>
39 This job runs <b>every weekday</b> and by default uses the <b>integration</b> branch on trustedfirmware.org.
40 properties:
41 - build-discarder:
Leonardo Sandovala4feb552021-03-02 12:10:21 -060042 days-to-keep: 14
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050043 - authorization:
Leonardo Sandovalebca8822021-01-25 18:20:04 -060044 !include: authorization.yaml.inc
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050045 parameters:
46 - string:
47 name: TF_GERRIT_PROJECT
48 default: 'TF-A/trusted-firmware-a'
49 - string:
50 name: TF_GERRIT_BRANCH
51 default: 'refs/heads/integration'
52 - string:
53 name: TF_GERRIT_REFSPEC
54 default: '+refs/heads/integration:refs/remotes/origin/integration'
Leonardo Sandoval7e95c662021-02-03 12:54:51 -060055 - string:
56 name: COVERITY_VERSION
57 default: '2020.09'
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050058 - bool:
59 name: UPLOAD_TO_COVERITY_SCAN_ONLINE
60 default: false
61 scm:
62 - tf-a-ci-scripts
63 - trusted-firmware-a
64 wrappers:
65 - timestamps
66 - credentials-binding:
67 - text:
68 credential-id: TF-COVERITY-SCAN-TOKEN
69 variable: TF_COVERITY_SCAN_TOKEN
70 builders:
Fathi Boudra9c8a9452020-12-08 22:16:57 +010071 - shell: |
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050072 #!/bin/bash
Leonardo Sandovalf950b642020-12-03 21:41:54 -060073 set -e
Leonardo Sandovalf950b642020-12-03 21:41:54 -060074 # Install crypto library
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050075 CRYPTOCELL_LIB_PATH=/arm/projectscratch/ssg/trusted-fw
76 mkdir -p ${CRYPTOCELL_LIB_PATH}
77 cd ${CRYPTOCELL_LIB_PATH}
78 curl --connect-timeout 5 --retry 5 --retry-delay 1 \
79 -sLSO -C - https://downloads.trustedfirmware.org/tf-a/dummy-crypto-lib.tar
80 tar xf dummy-crypto-lib.tar
Leonardo Sandovalf950b642020-12-03 21:41:54 -060081 # Fetch coverity tool and untar it
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050082 cd ${WORKSPACE}
83 wget https://scan.coverity.com/download/linux64 \
84 --quiet \
85 --post-data "token=${TF_COVERITY_SCAN_TOKEN}&project=ARM-software%2Farm-trusted-firmware" \
86 -O coverity_tool.tgz
87 tar -xzf coverity_tool.tgz
88 mv cov-analysis-linux64-${COVERITY_VERSION} coverity
89 export PATH=${WORKSPACE}/coverity/bin:${PATH}
Leonardo Sandovalf950b642020-12-03 21:41:54 -060090 # Run coverity
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050091 cd ${WORKSPACE}/trusted-firmware-a
92 ${WORKSPACE}/tf-a-ci-scripts/script/tf-coverity/run_coverity_on_tf.py --tf $(pwd)
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050093 - conditional-step:
94 condition-kind: boolean-expression
95 condition-expression: "${UPLOAD_TO_COVERITY_SCAN_ONLINE}"
96 on-evaluation-failure: dont-run
97 steps:
Fathi Boudra9c8a9452020-12-08 22:16:57 +010098 - shell: |
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050099 #!/bin/bash
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -0500100 echo "Uploading tarball to Coverity Scan Online..."
101 GIT_COMMIT=$(git rev-parse HEAD)
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -0500102 curl \
103 --form token=${{TF_COVERITY_SCAN_TOKEN}} \
104 --form email=sandrine.bailleux@arm.com \
105 --form file=@"arm-tf-coverity-results.tgz" \
106 --form version="Commit ${{GIT_COMMIT}}" \
107 --form description="Build ${{BUILD_DISPLAY_NAME}}" \
108 https://scan.coverity.com/builds?project=ARM-software%2Farm-trusted-firmware
Leonardo Sandoval81c17c62021-01-14 16:31:28 -0600109 publishers:
110 - archive:
111 artifacts: 'trusted-firmware-a/arm-tf-coverity-results.tgz, trusted-firmware-a/tf_coverage.log'
Fathi Boudra8aa4bd82021-01-15 10:30:57 +0100112 - groovy-postbuild:
113 script:
114 !include-raw:
115 - tf-coverity/postbuild.groovy