Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 1 | - job: |
Leonardo Sandoval | ffaee98 | 2021-11-11 10:27:57 -0600 | [diff] [blame] | 2 | name: tf-a-static-checks |
Paul Sokolovsky | 2315d61 | 2023-08-05 07:36:23 +0300 | [diff] [blame] | 3 | node: docker-amd64-tf-a-jammy |
Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 4 | project-type: freestyle |
| 5 | concurrent: true |
| 6 | disabled: false |
| 7 | defaults: global |
| 8 | description: Run static checks on Git repository |
| 9 | properties: |
| 10 | - build-discarder: |
Leonardo Sandoval | a4feb55 | 2021-03-02 12:10:21 -0600 | [diff] [blame] | 11 | days-to-keep: 14 |
Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 12 | parameters: |
| 13 | - string: |
| 14 | name: TF_GERRIT_PROJECT |
| 15 | default: 'TF-A/trusted-firmware-a' |
| 16 | - string: |
| 17 | name: TF_GERRIT_BRANCH |
Leonardo Sandoval | 3da340d | 2021-02-09 14:53:30 -0600 | [diff] [blame] | 18 | default: 'refs/heads/integration' |
Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 19 | - string: |
| 20 | name: TF_GERRIT_REFSPEC |
Leonardo Sandoval | 3da340d | 2021-02-09 14:53:30 -0600 | [diff] [blame] | 21 | default: '+refs/heads/integration:refs/remotes/origin/integration' |
Leonardo Sandoval | ecbc6f4 | 2021-03-19 10:36:24 -0600 | [diff] [blame] | 22 | - string: |
| 23 | name: TFTF_GERRIT_PROJECT |
| 24 | default: 'TF-A/tf-a-tests' |
| 25 | - string: |
| 26 | name: TFTF_GERRIT_BRANCH |
| 27 | default: 'refs/heads/master' |
| 28 | - string: |
| 29 | name: TFTF_GERRIT_REFSPEC |
| 30 | default: '+refs/heads/master:refs/remotes/origin/master' |
Zelalem Aweke | e8801df | 2021-10-25 13:41:44 -0500 | [diff] [blame] | 31 | - string: |
| 32 | name: CI_REFSPEC |
| 33 | default: '+refs/heads/master:refs/remotes/origin/master' |
Saheer Babu | b495f03 | 2025-01-21 23:01:11 +0000 | [diff] [blame] | 34 | - string: |
| 35 | name: JOBS_REFSPEC |
| 36 | default: 'refs/heads/master' |
| 37 | description: | |
| 38 | tf-a-job-configs refspec to use. The master branch is used by default. |
Leonardo Sandoval | ecbc6f4 | 2021-03-19 10:36:24 -0600 | [diff] [blame] | 39 | - choice: |
| 40 | name: REPO_UNDER_TEST |
| 41 | choices: |
| 42 | - trusted-firmware-a |
| 43 | - tf-a-tests |
| 44 | default: trusted-firmware-a |
| 45 | description: |- |
| 46 | Repository to run static checks on. |
Leonardo Sandoval | d1b6b5a | 2021-09-13 12:06:26 -0500 | [diff] [blame] | 47 | - string: |
Paul Sokolovsky | 66aadcb | 2024-06-27 12:51:33 +0300 | [diff] [blame] | 48 | name: GERRIT_BRANCH |
| 49 | default: '' |
| 50 | - string: |
Leonardo Sandoval | d1b6b5a | 2021-09-13 12:06:26 -0500 | [diff] [blame] | 51 | name: SHARE_FOLDER |
| 52 | default: '/srv/shared/${JOB_NAME}/${BUILD_NUMBER}' |
| 53 | description: 'Folder containing shared repositories for downstream pipeline jobs' |
Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 54 | wrappers: |
| 55 | - timestamps |
| 56 | - timeout: |
Paul Sokolovsky | f0adb08 | 2023-10-27 08:45:55 +0300 | [diff] [blame] | 57 | timeout: 240 |
Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 58 | fail: true |
| 59 | builders: |
Leonardo Sandoval | d1b6b5a | 2021-09-13 12:06:26 -0500 | [diff] [blame] | 60 | - shell: |
| 61 | !include-raw: scripts/clone.sh |
Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 62 | - shell: | |
| 63 | #!/bin/bash |
| 64 | set -e |
Leonardo Sandoval | ecbc6f4 | 2021-03-19 10:36:24 -0600 | [diff] [blame] | 65 | if [[ "${REPO_UNDER_TEST}" == trusted-firmware-a ]]; then |
| 66 | cat <<EOF > env.param |
| 67 | QA_SERVER_PROJECT=${JOB_NAME} |
| 68 | QA_SERVER_VERSION=${BUILD_NUMBER} |
Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 69 | GERRIT_PROJECT=${TF_GERRIT_PROJECT} |
| 70 | GERRIT_BRANCH=${TF_GERRIT_BRANCH} |
| 71 | GERRIT_REFSPEC=${TF_GERRIT_REFSPEC} |
Leonardo Sandoval | ecbc6f4 | 2021-03-19 10:36:24 -0600 | [diff] [blame] | 72 | TEST_GROUPS=tf-l2-scan-build |
Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 73 | EOF |
Leonardo Sandoval | ecbc6f4 | 2021-03-19 10:36:24 -0600 | [diff] [blame] | 74 | fi |
| 75 | cd ${WORKSPACE}/${REPO_UNDER_TEST} |
Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 76 | # Executed project-related static checks: copyright presence, headers in alphabetical order, |
| 77 | # line endings, coding style and banned API. |
| 78 | IS_CONTINUOUS_INTEGRATION=1 ${WORKSPACE}/tf-a-ci-scripts/script/static-checks/static-checks.sh |
Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 79 | - trigger-builds: |
Leonardo Sandoval | ffaee98 | 2021-11-11 10:27:57 -0600 | [diff] [blame] | 80 | - project: tf-a-ci-gateway |
Leonardo Sandoval | 9f11c92 | 2021-02-16 09:13:53 -0600 | [diff] [blame] | 81 | block: true |
Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 82 | property-file: env.param |
Harrison Mutai | 98608e6 | 2023-04-21 14:19:22 +0100 | [diff] [blame] | 83 | current-parameters: true |
Leonardo Sandoval | ffaee98 | 2021-11-11 10:27:57 -0600 | [diff] [blame] | 84 | # Do not trigger tf-a-ci-gateway if env.param file does not exist, |
Leonardo Sandoval | ecbc6f4 | 2021-03-19 10:36:24 -0600 | [diff] [blame] | 85 | # which is the case here for TF-A Tests repository |
| 86 | property-file-fail-on-missing: True |
Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 87 | publishers: |
| 88 | - archive: |
Leonardo Sandoval | ecbc6f4 | 2021-03-19 10:36:24 -0600 | [diff] [blame] | 89 | artifacts: '${REPO_UNDER_TEST}/static-checks.log' |
Leonardo Sandoval | 46226da | 2021-01-15 13:55:56 -0600 | [diff] [blame] | 90 | - groovy-postbuild: |
| 91 | script: |
| 92 | !include-raw: |
Leonardo Sandoval | ffaee98 | 2021-11-11 10:27:57 -0600 | [diff] [blame] | 93 | - tf-a-static-checks/postbuild.groovy |