blob: 8c3599a58540c8de9ace852f8be0aa357803fb94 [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 Sandoval81c17c62021-01-14 16:31:28 -060041 days-to-keep: 7
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050042 - 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 Boudra9c8a9452020-12-08 22:16:57 +010077 - shell: |
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -050078 #!/bin/bash
Fathi Boudra9c8a9452020-12-08 22:16:57 +010079
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:
Fathi Boudra9c8a9452020-12-08 22:16:57 +0100110 - shell: |
Leonardo Sandoval37ce1aa2020-10-16 16:56:16 -0500111 #!/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 Sandoval81c17c62021-01-14 16:31:28 -0600124 - 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'