Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 1 | - job: |
| 2 | name: saurom-tf-a-builder |
Saul Romero | 97ecc7e | 2023-03-09 10:48:19 +0000 | [diff] [blame] | 3 | node: docker-amd64-tf-a-jammy |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 4 | project-type: freestyle |
| 5 | concurrent: true |
| 6 | disabled: false |
| 7 | defaults: global |
| 8 | Description: | |
| 9 | Trusted Firmware A (TF-A) builder |
| 10 | properties: |
| 11 | - build-discarder: |
| 12 | days-to-keep: 15 |
Saul Romero | e0faac7 | 2023-03-17 15:27:05 +0000 | [diff] [blame] | 13 | artifact-num-to-keep: 40000 |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 14 | - 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 Romero | 3c23398 | 2023-06-28 15:45:33 +0100 | [diff] [blame] | 46 | name: CI_REFSPEC |
| 47 | default: '+refs/heads/master:refs/remotes/origin/master' |
| 48 | - string: |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 49 | name: DOCKER_REGISTRY |
| 50 | default: '987685672616.dkr.ecr.us-east-1.amazonaws.com' |
| 51 | - string: |
| 52 | name: ARMLMD_LICENSE_FILE |
| 53 | default: '27000@flexnet.trustedfirmware.org' |
| 54 | - string: |
| 55 | name: JUNO_ROOTFS_URL |
| 56 | default: 'http://releases.linaro.org/openembedded/aarch64/17.01/linaro-image-minimal-genericarmv8-20170127-888.rootfs.tar.gz' |
| 57 | - string: |
| 58 | name: MBEDTLS_URL |
Saul Romero | a14d4c0 | 2023-11-09 14:31:07 +0000 | [diff] [blame] | 59 | default: 'https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.4.1.tar.gz' |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 60 | - string: |
| 61 | name: GERRIT_PATCHSET_NUMBER |
| 62 | default: '' |
| 63 | - string: |
| 64 | name: GERRIT_CHANGE_NUMBER |
| 65 | default: '' |
| 66 | - string: |
| 67 | name: GERRIT_HOST |
| 68 | default: 'review.trustedfirmware.org' |
| 69 | - string: |
| 70 | name: QA_SERVER_TEAM |
| 71 | default: 'tf' |
| 72 | - string: |
| 73 | name: QA_SERVER_PROJECT |
| 74 | default: 'tf-a' |
| 75 | - string: |
| 76 | name: QA_SERVER_VERSION |
| 77 | default: ${BUILD_NUMBER} |
| 78 | - string: |
| 79 | name: QA_SERVER |
| 80 | default: 'https://qa-reports.linaro.org' |
| 81 | - string: |
| 82 | name: QA_TOOLS_REPO |
Saul Romero | 3c23398 | 2023-06-28 15:45:33 +0100 | [diff] [blame] | 83 | default: 'https://git.gitlab.arm.com/tooling/qa-tools.git' |
Saul Romero | e0faac7 | 2023-03-17 15:27:05 +0000 | [diff] [blame] | 84 | - string: |
| 85 | name: QA_TOOLS_BRANCH |
Saul Romero | 3c23398 | 2023-06-28 15:45:33 +0100 | [diff] [blame] | 86 | default: 'master' |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 87 | - string: |
Saul Romero | a14d4c0 | 2023-11-09 14:31:07 +0000 | [diff] [blame] | 88 | name: LAVA_RETRIES |
| 89 | default: 2 |
| 90 | description: | |
| 91 | Number of tries submitting job to LAVA in case it fails (stopgap measure against nondeterministic failures) |
| 92 | - string: |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 93 | name: SHARE_FOLDER |
| 94 | default: '/srv/shared/${JOB_NAME}/${BUILD_NUMBER}' |
| 95 | description: 'Folder containing shared repositories for downstream pipeline jobs' |
| 96 | wrappers: |
| 97 | - timestamps |
| 98 | - timeout: |
| 99 | timeout: 120 |
| 100 | fail: true |
| 101 | - credentials-binding: |
| 102 | - text: |
| 103 | credential-id: QA_REPORTS_TOKEN |
| 104 | variable: QA_REPORTS_TOKEN |
| 105 | - credentials-binding: |
| 106 | - text: |
| 107 | credential-id: LAVA_USER_TF |
| 108 | variable: LAVA_USER |
| 109 | - credentials-binding: |
| 110 | - text: |
| 111 | credential-id: LAVA_TOKEN_TF |
| 112 | variable: LAVA_TOKEN |
Saul Romero | a14d4c0 | 2023-11-09 14:31:07 +0000 | [diff] [blame] | 113 | # - credentials-binding: |
| 114 | # - text: |
| 115 | # credential-id: ARMCLANG_UBL_CODE |
| 116 | # variable: ARMCLANG_UBL_CODE |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 117 | builders: |
Saul Romero | 3c23398 | 2023-06-28 15:45:33 +0100 | [diff] [blame] | 118 | - shell: | |
| 119 | aarch64-none-elf-gcc -v || true |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 120 | - shell: |
Saul Romero | 0b8a6d7 | 2023-02-10 10:04:27 +0000 | [diff] [blame] | 121 | !include-raw: saurom-scripts/clone.sh |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 122 | - shell: |
Saul Romero | 4d3656e | 2023-02-07 13:13:56 +0000 | [diff] [blame] | 123 | !include-raw: saurom-tf-a-builder/builders.sh |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 124 | - inject: |
| 125 | properties-file: artefacts/env |
| 126 | - shell: | |
| 127 | ln -s "artefacts/${BIN_MODE:-release}" "artefacts-lava" |
Saul Romero | 3c23398 | 2023-06-28 15:45:33 +0100 | [diff] [blame] | 128 | echo ${BIN_MODE:-release} >lava-binmode.txt |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 129 | - conditional-step: |
| 130 | condition-kind: file-exists |
| 131 | on-evaluation-failure: dont-run |
| 132 | condition-filename: artefacts-lava/job.yaml |
| 133 | condition-basedir: workspace |
| 134 | steps: |
| 135 | - shell: | |
| 136 | #!/bin/bash |
| 137 | set -e |
Saul Romero | d4e9052 | 2023-06-29 11:36:44 +0100 | [diff] [blame] | 138 | set -x |
Saul Romero | 77e6425 | 2023-06-30 12:25:48 +0100 | [diff] [blame] | 139 | cat ${WORKSPACE}/artefacts-lava/job.yaml |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 140 | DEVICE_TYPE=fvp |
| 141 | CUSTOM_YAML_URL=${BUILD_URL}/artifact/artefacts-lava/job.yaml |
| 142 | DEVICE_TYPE=$(awk -F': ' '/device_type/ {print $2}' ${WORKSPACE}/artefacts-lava/job.yaml) |
| 143 | cat << EOF > ${WORKSPACE}/lava.param |
| 144 | DEVICE_TYPE=${DEVICE_TYPE} |
| 145 | LAVA_SERVER=tf.validation.linaro.org |
| 146 | EOF |
| 147 | publishers: |
| 148 | - archive: |
Saul Romero | 3c23398 | 2023-06-28 15:45:33 +0100 | [diff] [blame] | 149 | artifacts: artefacts/**, artefacts-lava/**, lava-binmode.txt |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 150 | latest-only: false |
| 151 | allow-empty: true |
| 152 | - conditional-publisher: |
| 153 | - condition-kind: file-exists |
| 154 | on-evaluation-failure: dont-run |
| 155 | condition-filename: artefacts-lava/job.yaml |
| 156 | condition-basedir: workspace |
| 157 | action: |
| 158 | - postbuildscript: |
| 159 | builders: |
| 160 | - role: SLAVE |
| 161 | build-on: |
| 162 | - SUCCESS |
| 163 | build-steps: |
| 164 | - inject: |
| 165 | properties-file: ${WORKSPACE}/lava.param |
| 166 | - shell: | |
| 167 | #!/bin/bash |
Saul Romero | d4e9052 | 2023-06-29 11:36:44 +0100 | [diff] [blame] | 168 | set -x |
Saul Romero | 3c23398 | 2023-06-28 15:45:33 +0100 | [diff] [blame] | 169 | submit_job='tf-a-job-configs/saurom-tf-a-builder/submit-test-job.sh' |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 170 | # FIXME: Juno and FVP jobs may fail due to non-related users changes, |
| 171 | # so CI needs to resubmit the job, at most three times: |
| 172 | # Juno jobs may fail due to LAVA lab infrastructure issues (see |
| 173 | # https://projects.linaro.org/browse/LSS-2128) |
| 174 | # FVP jobs may hang at some particular TFTF test (see |
| 175 | # https://linaro.atlassian.net/browse/TFC-176) |
Saul Romero | e0faac7 | 2023-03-17 15:27:05 +0000 | [diff] [blame] | 176 | passed=0 |
| 177 | for i in $(seq 1 3); do |
Saul Romero | 3c23398 | 2023-06-28 15:45:33 +0100 | [diff] [blame] | 178 | echo "# LAVA submission iteration #$i" |
| 179 | if $submit_job; then |
Saul Romero | e0faac7 | 2023-03-17 15:27:05 +0000 | [diff] [blame] | 180 | passed=1 |
| 181 | break |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 182 | fi |
Saul Romero | e0faac7 | 2023-03-17 15:27:05 +0000 | [diff] [blame] | 183 | done |
Saul Romero | 3c23398 | 2023-06-28 15:45:33 +0100 | [diff] [blame] | 184 | tf-a-job-configs/saurom-tf-a-builder/lava-log-process.sh |
Saul Romero | e0faac7 | 2023-03-17 15:27:05 +0000 | [diff] [blame] | 185 | if [ $passed -eq 0 ]; then |
| 186 | echo "LAVA JOB RESULT: 1" |
Saul Romero | 3c23398 | 2023-06-28 15:45:33 +0100 | [diff] [blame] | 187 | exit 1 |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 188 | else |
| 189 | echo "LAVA JOB RESULT: 0" |
| 190 | fi |
| 191 | - postbuildscript: |
| 192 | builders: |
| 193 | - role: SLAVE |
| 194 | build-on: |
| 195 | - SUCCESS |
| 196 | build-steps: |
| 197 | - shell: | |
| 198 | #!/bin/bash -e |
| 199 | echo "=== Starting expect-post tests ===" |
| 200 | ./tf-a-ci-scripts/script/expect-post-runner.sh |
| 201 | - conditional-publisher: |
| 202 | - condition-kind: file-exists |
| 203 | on-evaluation-failure: dont-run |
| 204 | condition-filename: lava-raw-debug.log |
| 205 | condition-basedir: workspace |
| 206 | action: |
| 207 | - archive: |
Saul Romero | e0faac7 | 2023-03-17 15:27:05 +0000 | [diff] [blame] | 208 | artifacts: lava-raw-debug.log |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 209 | latest-only: false |
| 210 | allow-empty: true |
Saul Romero | e0faac7 | 2023-03-17 15:27:05 +0000 | [diff] [blame] | 211 | - archive: |
| 212 | artifacts: lava.log, lava-*.log, feedback.log, config_file.json, covtrace-*.log, trace_report/**,lava.log, lava-uart?.log, feedback.log, config_file.json, covtrace-*.log, trace_report/**, *.dump, *.json, *.info |
| 213 | latest-only: false |
| 214 | allow-empty: true |
Saul Romero | 33f858f | 2023-02-06 11:15:47 +0000 | [diff] [blame] | 215 | - groovy-postbuild: |
| 216 | script: |
| 217 | !include-raw: |
| 218 | - tf-a-builder/postbuild.groovy |