blob: 468f03be3954c8321e0a2ce95c5b640c5263024a [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
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 Sandovala4feb552021-03-02 12:10:21 -060041 days-to-keep: 14
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050042 - authorization:
Leonardo Sandovalebca8822021-01-25 18:20:04 -060043 !include: authorization.yaml.inc
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050044 parameters:
45 - string:
46 name: TF_GERRIT_PROJECT
47 default: 'TF-A/trusted-firmware-a'
48 - string:
49 name: TF_GERRIT_BRANCH
50 default: 'refs/heads/integration'
51 - string:
52 name: TF_GERRIT_REFSPEC
53 default: '+refs/heads/integration:refs/remotes/origin/integration'
Leonardo Sandoval7e95c662021-02-03 12:54:51 -060054 - string:
55 name: COVERITY_VERSION
56 default: '2020.09'
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050057 - bool:
58 name: UPLOAD_TO_COVERITY_SCAN_ONLINE
59 default: false
60 scm:
61 - tf-a-ci-scripts
62 - trusted-firmware-a
63 wrappers:
64 - timestamps
65 - credentials-binding:
66 - text:
67 credential-id: TF-COVERITY-SCAN-TOKEN
68 variable: TF_COVERITY_SCAN_TOKEN
69 builders:
Fathi Boudra9c8a9452020-12-08 22:16:57 +010070 - shell: |
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050071 #!/bin/bash
Leonardo Sandovalf950b642020-12-03 21:41:54 -060072 set -e
Leonardo Sandovalf950b642020-12-03 21:41:54 -060073 # Install crypto library
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050074 CRYPTOCELL_LIB_PATH=/arm/projectscratch/ssg/trusted-fw
75 mkdir -p ${CRYPTOCELL_LIB_PATH}
76 cd ${CRYPTOCELL_LIB_PATH}
77 curl --connect-timeout 5 --retry 5 --retry-delay 1 \
78 -sLSO -C - https://downloads.trustedfirmware.org/tf-a/dummy-crypto-lib.tar
79 tar xf dummy-crypto-lib.tar
Leonardo Sandovalf950b642020-12-03 21:41:54 -060080 # Fetch coverity tool and untar it
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050081 cd ${WORKSPACE}
82 wget https://scan.coverity.com/download/linux64 \
83 --quiet \
84 --post-data "token=${TF_COVERITY_SCAN_TOKEN}&project=ARM-software%2Farm-trusted-firmware" \
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}
Leonardo Sandovalf950b642020-12-03 21:41:54 -060089 # Run coverity
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050090 cd ${WORKSPACE}/trusted-firmware-a
91 ${WORKSPACE}/tf-a-ci-scripts/script/tf-coverity/run_coverity_on_tf.py --tf $(pwd)
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050092 - conditional-step:
93 condition-kind: boolean-expression
94 condition-expression: "${UPLOAD_TO_COVERITY_SCAN_ONLINE}"
95 on-evaluation-failure: dont-run
96 steps:
Fathi Boudra9c8a9452020-12-08 22:16:57 +010097 - shell: |
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050098 #!/bin/bash
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050099 echo "Uploading tarball to Coverity Scan Online..."
100 GIT_COMMIT=$(git rev-parse HEAD)
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -0500101 curl \
102 --form token=${{TF_COVERITY_SCAN_TOKEN}} \
103 --form email=sandrine.bailleux@arm.com \
104 --form file=@"arm-tf-coverity-results.tgz" \
105 --form version="Commit ${{GIT_COMMIT}}" \
106 --form description="Build ${{BUILD_DISPLAY_NAME}}" \
107 https://scan.coverity.com/builds?project=ARM-software%2Farm-trusted-firmware
Leonardo Sandoval81c17c62021-01-14 16:31:28 -0600108 publishers:
109 - archive:
110 artifacts: 'trusted-firmware-a/arm-tf-coverity-results.tgz, trusted-firmware-a/tf_coverage.log'
Fathi Boudra8aa4bd82021-01-15 10:30:57 +0100111 - groovy-postbuild:
112 script:
113 !include-raw:
114 - tf-coverity/postbuild.groovy