blob: 9b81a9af1404dd6c26f543f415724abe018c1360 [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
80 set -xe
81
82 export PS4='${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]}() - [${SHLVL},${BASH_SUBSHELL},$?] '
83
84 FIXME: node bionic-amd64-tf-a-build does not set correctly PATH=$TOOLS_DIR/bin:$PATH
85 TOOLS_DIR=/home/buildslave/tools
86 export PATH=${TOOLS_DIR}/bin:${PATH}
87
88 Install crypto library
89 CRYPTOCELL_LIB_PATH=/arm/projectscratch/ssg/trusted-fw
90 mkdir -p ${CRYPTOCELL_LIB_PATH}
91 cd ${CRYPTOCELL_LIB_PATH}
92 curl --connect-timeout 5 --retry 5 --retry-delay 1 \
93 -sLSO -C - https://downloads.trustedfirmware.org/tf-a/dummy-crypto-lib.tar
94 tar xf dummy-crypto-lib.tar
95
96 Fetch coverity tool and untar it
97 COVERITY_VERSION=2019.03
98 cd ${WORKSPACE}
99 wget https://scan.coverity.com/download/linux64 \
100 --quiet \
101 --post-data "token=${TF_COVERITY_SCAN_TOKEN}&project=ARM-software%2Farm-trusted-firmware" \
102 -O coverity_tool.tgz
103 tar -xzf coverity_tool.tgz
104 mv cov-analysis-linux64-${COVERITY_VERSION} coverity
105 export PATH=${WORKSPACE}/coverity/bin:${PATH}
106
107 Run coverity
108 cd ${WORKSPACE}/trusted-firmware-a
109 ${WORKSPACE}/tf-a-ci-scripts/script/tf-coverity/run_coverity_on_tf.py --tf $(pwd)
110
111 - conditional-step:
112 condition-kind: boolean-expression
113 condition-expression: "${UPLOAD_TO_COVERITY_SCAN_ONLINE}"
114 on-evaluation-failure: dont-run
115 steps:
116 - shell: |-
117 #!/bin/bash
118
119 echo "Uploading tarball to Coverity Scan Online..."
120 GIT_COMMIT=$(git rev-parse HEAD)
121
122 curl \
123 --form token=${{TF_COVERITY_SCAN_TOKEN}} \
124 --form email=sandrine.bailleux@arm.com \
125 --form file=@"arm-tf-coverity-results.tgz" \
126 --form version="Commit ${{GIT_COMMIT}}" \
127 --form description="Build ${{BUILD_DISPLAY_NAME}}" \
128 https://scan.coverity.com/builds?project=ARM-software%2Farm-trusted-firmware
129 triggers:
130 - timed: H H(4-6) * * 1-5