blob: eb4b45bd6c8fd90228789fcb7c7ab44ea8abc491 [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:
41 days-to-keep: 180
42 num-to-keep: 180
43 - authorization:
44 anonymous:
45 - job-discover
46 - job-read
47 - job-extended-read
48 - job-workspace
49 lsandov1:
50 - job-read
51 - job-extended-read
52 - job-build
53 - job-cancel
54 - run-update
55 parameters:
56 - string:
57 name: TF_GERRIT_PROJECT
58 default: 'TF-A/trusted-firmware-a'
59 - string:
60 name: TF_GERRIT_BRANCH
61 default: 'refs/heads/integration'
62 - string:
63 name: TF_GERRIT_REFSPEC
64 default: '+refs/heads/integration:refs/remotes/origin/integration'
65 - bool:
66 name: UPLOAD_TO_COVERITY_SCAN_ONLINE
67 default: false
68 scm:
69 - tf-a-ci-scripts
70 - trusted-firmware-a
71 wrappers:
72 - timestamps
73 - credentials-binding:
74 - text:
75 credential-id: TF-COVERITY-SCAN-TOKEN
76 variable: TF_COVERITY_SCAN_TOKEN
77 builders:
78 - shell: |-
79 #!/bin/bash
Leonardo Sandovalf950b642020-12-03 21:41:54 -060080 set -e
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050081
Leonardo Sandovalf950b642020-12-03 21:41:54 -060082 # Install crypto library
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050083 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 Sandovalf950b642020-12-03 21:41:54 -060090 # Fetch coverity tool and untar it
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050091 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 Sandovalf950b642020-12-03 21:41:54 -0600101 # Run coverity
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -0500102 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:
110 - shell: |-
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:
124 - timed: H H(4-6) * * 1-5