blob: e6fd6e337551cb9fbc02c0850cacec139814ecde [file] [log] [blame]
Saul Romero33f858f2023-02-06 11:15:47 +00001- job:
2 name: saurom-tf-a-builder
Saul Romero97ecc7e2023-03-09 10:48:19 +00003 node: docker-amd64-tf-a-jammy
Saul Romero33f858f2023-02-06 11:15:47 +00004 project-type: freestyle
5 concurrent: true
6 disabled: false
7 defaults: global
Paul Sokolovsky528f0dd2024-11-02 22:15:53 +07008 description: |
Saul Romero33f858f2023-02-06 11:15:47 +00009 Trusted Firmware A (TF-A) builder
10 properties:
11 - build-discarder:
12 days-to-keep: 15
Saul Romeroe0faac72023-03-17 15:27:05 +000013 artifact-num-to-keep: 40000
Saul Romero33f858f2023-02-06 11:15:47 +000014 - authorization:
15 !include: saurom-authorization.yaml.inc
16 parameters:
17 - string:
18 name: import_cc
19 - string:
20 name: TEST_CONFIG
21 description: |
22 Original test configuration.
23 - string:
24 name: TEST_DESC
25 description: |
26 Expanded and normalized test configuration, aka "test description"
27 - string:
28 name: TF_GERRIT_PROJECT
29 default: 'TF-A/trusted-firmware-a'
30 - string:
31 name: TF_GERRIT_BRANCH
32 default: 'refs/heads/master'
33 - string:
34 name: TF_GERRIT_REFSPEC
35 default: '+refs/heads/master:refs/remotes/origin/master'
36 - string:
37 name: TFTF_GERRIT_PROJECT
38 default: 'TF-A/tf-a-tests'
39 - string:
40 name: TFTF_GERRIT_BRANCH
41 default: 'refs/heads/master'
42 - string:
43 name: TFTF_GERRIT_REFSPEC
44 default: '+refs/heads/master:refs/remotes/origin/master'
45 - string:
Saul Romero3c233982023-06-28 15:45:33 +010046 name: CI_REFSPEC
47 default: '+refs/heads/master:refs/remotes/origin/master'
48 - string:
Saul Romero33f858f2023-02-06 11:15:47 +000049 name: DOCKER_REGISTRY
50 default: '987685672616.dkr.ecr.us-east-1.amazonaws.com'
51 - string:
Saul Romero33f858f2023-02-06 11:15:47 +000052 name: JUNO_ROOTFS_URL
53 default: 'http://releases.linaro.org/openembedded/aarch64/17.01/linaro-image-minimal-genericarmv8-20170127-888.rootfs.tar.gz'
54 - string:
55 name: MBEDTLS_URL
Saul Romeroa14d4c02023-11-09 14:31:07 +000056 default: 'https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.4.1.tar.gz'
Saul Romero33f858f2023-02-06 11:15:47 +000057 - string:
58 name: GERRIT_PATCHSET_NUMBER
59 default: ''
60 - string:
61 name: GERRIT_CHANGE_NUMBER
62 default: ''
63 - string:
64 name: GERRIT_HOST
65 default: 'review.trustedfirmware.org'
66 - string:
67 name: QA_SERVER_TEAM
68 default: 'tf'
69 - string:
70 name: QA_SERVER_PROJECT
71 default: 'tf-a'
72 - string:
73 name: QA_SERVER_VERSION
74 default: ${BUILD_NUMBER}
75 - string:
76 name: QA_SERVER
77 default: 'https://qa-reports.linaro.org'
78 - string:
79 name: QA_TOOLS_REPO
Saul Romero3c233982023-06-28 15:45:33 +010080 default: 'https://git.gitlab.arm.com/tooling/qa-tools.git'
Saul Romeroe0faac72023-03-17 15:27:05 +000081 - string:
82 name: QA_TOOLS_BRANCH
Saul Romero3c233982023-06-28 15:45:33 +010083 default: 'master'
Saul Romero33f858f2023-02-06 11:15:47 +000084 - string:
Saul Romeroa14d4c02023-11-09 14:31:07 +000085 name: LAVA_RETRIES
86 default: 2
87 description: |
88 Number of tries submitting job to LAVA in case it fails (stopgap measure against nondeterministic failures)
89 - string:
Saul Romero33f858f2023-02-06 11:15:47 +000090 name: SHARE_FOLDER
91 default: '/srv/shared/${JOB_NAME}/${BUILD_NUMBER}'
92 description: 'Folder containing shared repositories for downstream pipeline jobs'
93 wrappers:
94 - timestamps
95 - timeout:
96 timeout: 120
97 fail: true
98 - credentials-binding:
99 - text:
100 credential-id: QA_REPORTS_TOKEN
101 variable: QA_REPORTS_TOKEN
102 - credentials-binding:
103 - text:
104 credential-id: LAVA_USER_TF
105 variable: LAVA_USER
106 - credentials-binding:
107 - text:
108 credential-id: LAVA_TOKEN_TF
109 variable: LAVA_TOKEN
Saul Romeroa14d4c02023-11-09 14:31:07 +0000110# - credentials-binding:
111# - text:
112# credential-id: ARMCLANG_UBL_CODE
113# variable: ARMCLANG_UBL_CODE
Saul Romero33f858f2023-02-06 11:15:47 +0000114 builders:
Saul Romero3c233982023-06-28 15:45:33 +0100115 - shell: |
116 aarch64-none-elf-gcc -v || true
Saul Romero33f858f2023-02-06 11:15:47 +0000117 - shell:
Saul Romero0b8a6d72023-02-10 10:04:27 +0000118 !include-raw: saurom-scripts/clone.sh
Saul Romero33f858f2023-02-06 11:15:47 +0000119 - shell:
Saul Romero4d3656e2023-02-07 13:13:56 +0000120 !include-raw: saurom-tf-a-builder/builders.sh
Saul Romero33f858f2023-02-06 11:15:47 +0000121 - inject:
122 properties-file: artefacts/env
123 - shell: |
124 ln -s "artefacts/${BIN_MODE:-release}" "artefacts-lava"
Saul Romero3c233982023-06-28 15:45:33 +0100125 echo ${BIN_MODE:-release} >lava-binmode.txt
Saul Romero33f858f2023-02-06 11:15:47 +0000126 - conditional-step:
127 condition-kind: file-exists
128 on-evaluation-failure: dont-run
129 condition-filename: artefacts-lava/job.yaml
130 condition-basedir: workspace
131 steps:
132 - shell: |
133 #!/bin/bash
134 set -e
Saul Romerod4e90522023-06-29 11:36:44 +0100135 set -x
Saul Romero77e64252023-06-30 12:25:48 +0100136 cat ${WORKSPACE}/artefacts-lava/job.yaml
Saul Romero33f858f2023-02-06 11:15:47 +0000137 DEVICE_TYPE=fvp
138 CUSTOM_YAML_URL=${BUILD_URL}/artifact/artefacts-lava/job.yaml
139 DEVICE_TYPE=$(awk -F': ' '/device_type/ {print $2}' ${WORKSPACE}/artefacts-lava/job.yaml)
140 cat << EOF > ${WORKSPACE}/lava.param
141 DEVICE_TYPE=${DEVICE_TYPE}
142 LAVA_SERVER=tf.validation.linaro.org
143 EOF
144 publishers:
145 - archive:
Saul Romero3c233982023-06-28 15:45:33 +0100146 artifacts: artefacts/**, artefacts-lava/**, lava-binmode.txt
Saul Romero33f858f2023-02-06 11:15:47 +0000147 latest-only: false
148 allow-empty: true
149 - conditional-publisher:
150 - condition-kind: file-exists
151 on-evaluation-failure: dont-run
152 condition-filename: artefacts-lava/job.yaml
153 condition-basedir: workspace
154 action:
155 - postbuildscript:
Saul Romero182df2c2023-11-13 10:15:02 +0000156 mark-unstable-if-failed: true
Saul Romero33f858f2023-02-06 11:15:47 +0000157 builders:
158 - role: SLAVE
159 build-on:
160 - SUCCESS
161 build-steps:
162 - inject:
163 properties-file: ${WORKSPACE}/lava.param
164 - shell: |
165 #!/bin/bash
Saul Romerod4e90522023-06-29 11:36:44 +0100166 set -x
Saul Romero3c233982023-06-28 15:45:33 +0100167 submit_job='tf-a-job-configs/saurom-tf-a-builder/submit-test-job.sh'
Saul Romero33f858f2023-02-06 11:15:47 +0000168 # FIXME: Juno and FVP jobs may fail due to non-related users changes,
169 # so CI needs to resubmit the job, at most three times:
170 # Juno jobs may fail due to LAVA lab infrastructure issues (see
171 # https://projects.linaro.org/browse/LSS-2128)
172 # FVP jobs may hang at some particular TFTF test (see
173 # https://linaro.atlassian.net/browse/TFC-176)
Saul Romeroe0faac72023-03-17 15:27:05 +0000174 passed=0
Saul Romero182df2c2023-11-13 10:15:02 +0000175 for i in $(seq 1 ${LAVA_RETRIES:-3}); do
Saul Romero3c233982023-06-28 15:45:33 +0100176 echo "# LAVA submission iteration #$i"
177 if $submit_job; then
Saul Romeroe0faac72023-03-17 15:27:05 +0000178 passed=1
179 break
Saul Romero33f858f2023-02-06 11:15:47 +0000180 fi
Saul Romeroe0faac72023-03-17 15:27:05 +0000181 done
Saul Romero3c233982023-06-28 15:45:33 +0100182 tf-a-job-configs/saurom-tf-a-builder/lava-log-process.sh
Saul Romeroe0faac72023-03-17 15:27:05 +0000183 if [ $passed -eq 0 ]; then
184 echo "LAVA JOB RESULT: 1"
Saul Romero3c233982023-06-28 15:45:33 +0100185 exit 1
Saul Romero33f858f2023-02-06 11:15:47 +0000186 else
187 echo "LAVA JOB RESULT: 0"
188 fi
189 - postbuildscript:
190 builders:
191 - role: SLAVE
192 build-on:
193 - SUCCESS
194 build-steps:
195 - shell: |
196 #!/bin/bash -e
197 echo "=== Starting expect-post tests ==="
198 ./tf-a-ci-scripts/script/expect-post-runner.sh
199 - conditional-publisher:
200 - condition-kind: file-exists
201 on-evaluation-failure: dont-run
202 condition-filename: lava-raw-debug.log
203 condition-basedir: workspace
204 action:
205 - archive:
Saul Romeroe0faac72023-03-17 15:27:05 +0000206 artifacts: lava-raw-debug.log
Saul Romero33f858f2023-02-06 11:15:47 +0000207 latest-only: false
208 allow-empty: true
Saul Romeroe0faac72023-03-17 15:27:05 +0000209 - archive:
Saul Romero6d462ba2023-11-15 13:45:34 +0000210 artifacts: lava*.log, feedback.log, **/config_file.json, covtrace-*.log, trace_report/**, **/output_file.json, **/*.dump, **/*.info
Saul Romeroe0faac72023-03-17 15:27:05 +0000211 latest-only: false
212 allow-empty: true
Saul Romero33f858f2023-02-06 11:15:47 +0000213 - groovy-postbuild:
214 script:
215 !include-raw:
216 - tf-a-builder/postbuild.groovy