blob: f87e5eb3c05e5f2ce3ffba4b7d1f69b1a16454e0 [file] [log] [blame]
Leonardo Sandoval46226da2021-01-15 13:55:56 -06001- job:
Leonardo Sandovalffaee982021-11-11 10:27:57 -06002 name: tf-a-static-checks
Paul Sokolovsky2315d612023-08-05 07:36:23 +03003 node: docker-amd64-tf-a-jammy
Leonardo Sandoval46226da2021-01-15 13:55:56 -06004 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 Sandovala4feb552021-03-02 12:10:21 -060011 days-to-keep: 14
Leonardo Sandoval46226da2021-01-15 13:55:56 -060012 - authorization:
Leonardo Sandovalebca8822021-01-25 18:20:04 -060013 !include: authorization.yaml.inc
Leonardo Sandoval46226da2021-01-15 13:55:56 -060014 parameters:
15 - string:
16 name: TF_GERRIT_PROJECT
17 default: 'TF-A/trusted-firmware-a'
18 - string:
19 name: TF_GERRIT_BRANCH
Leonardo Sandoval3da340d2021-02-09 14:53:30 -060020 default: 'refs/heads/integration'
Leonardo Sandoval46226da2021-01-15 13:55:56 -060021 - string:
22 name: TF_GERRIT_REFSPEC
Leonardo Sandoval3da340d2021-02-09 14:53:30 -060023 default: '+refs/heads/integration:refs/remotes/origin/integration'
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060024 - string:
25 name: TFTF_GERRIT_PROJECT
26 default: 'TF-A/tf-a-tests'
27 - string:
28 name: TFTF_GERRIT_BRANCH
29 default: 'refs/heads/master'
30 - string:
31 name: TFTF_GERRIT_REFSPEC
32 default: '+refs/heads/master:refs/remotes/origin/master'
Zelalem Awekee8801df2021-10-25 13:41:44 -050033 - string:
34 name: CI_REFSPEC
35 default: '+refs/heads/master:refs/remotes/origin/master'
Saheer Babub495f032025-01-21 23:01:11 +000036 - string:
37 name: JOBS_REFSPEC
38 default: 'refs/heads/master'
39 description: |
40 tf-a-job-configs refspec to use. The master branch is used by default.
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060041 - choice:
42 name: REPO_UNDER_TEST
43 choices:
44 - trusted-firmware-a
45 - tf-a-tests
46 default: trusted-firmware-a
47 description: |-
48 Repository to run static checks on.
Leonardo Sandovald1b6b5a2021-09-13 12:06:26 -050049 - string:
Paul Sokolovsky66aadcb2024-06-27 12:51:33 +030050 name: GERRIT_BRANCH
51 default: ''
52 - string:
Leonardo Sandovald1b6b5a2021-09-13 12:06:26 -050053 name: SHARE_FOLDER
54 default: '/srv/shared/${JOB_NAME}/${BUILD_NUMBER}'
55 description: 'Folder containing shared repositories for downstream pipeline jobs'
Leonardo Sandoval46226da2021-01-15 13:55:56 -060056 wrappers:
57 - timestamps
58 - timeout:
Paul Sokolovskyf0adb082023-10-27 08:45:55 +030059 timeout: 240
Leonardo Sandoval46226da2021-01-15 13:55:56 -060060 fail: true
61 builders:
Leonardo Sandovald1b6b5a2021-09-13 12:06:26 -050062 - shell:
63 !include-raw: scripts/clone.sh
Leonardo Sandoval46226da2021-01-15 13:55:56 -060064 - shell: |
65 #!/bin/bash
66 set -e
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060067 if [[ "${REPO_UNDER_TEST}" == trusted-firmware-a ]]; then
68 cat <<EOF > env.param
69 QA_SERVER_PROJECT=${JOB_NAME}
70 QA_SERVER_VERSION=${BUILD_NUMBER}
Leonardo Sandoval46226da2021-01-15 13:55:56 -060071 GERRIT_PROJECT=${TF_GERRIT_PROJECT}
72 GERRIT_BRANCH=${TF_GERRIT_BRANCH}
73 GERRIT_REFSPEC=${TF_GERRIT_REFSPEC}
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060074 TEST_GROUPS=tf-l2-scan-build
Leonardo Sandoval46226da2021-01-15 13:55:56 -060075 EOF
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060076 fi
77 cd ${WORKSPACE}/${REPO_UNDER_TEST}
Leonardo Sandoval46226da2021-01-15 13:55:56 -060078 # Executed project-related static checks: copyright presence, headers in alphabetical order,
79 # line endings, coding style and banned API.
80 IS_CONTINUOUS_INTEGRATION=1 ${WORKSPACE}/tf-a-ci-scripts/script/static-checks/static-checks.sh
Leonardo Sandoval46226da2021-01-15 13:55:56 -060081 - trigger-builds:
Leonardo Sandovalffaee982021-11-11 10:27:57 -060082 - project: tf-a-ci-gateway
Leonardo Sandoval9f11c922021-02-16 09:13:53 -060083 block: true
Leonardo Sandoval46226da2021-01-15 13:55:56 -060084 property-file: env.param
Harrison Mutai98608e62023-04-21 14:19:22 +010085 current-parameters: true
Leonardo Sandovalffaee982021-11-11 10:27:57 -060086 # Do not trigger tf-a-ci-gateway if env.param file does not exist,
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060087 # which is the case here for TF-A Tests repository
88 property-file-fail-on-missing: True
Leonardo Sandoval46226da2021-01-15 13:55:56 -060089 publishers:
90 - archive:
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060091 artifacts: '${REPO_UNDER_TEST}/static-checks.log'
Leonardo Sandoval46226da2021-01-15 13:55:56 -060092 - groovy-postbuild:
93 script:
94 !include-raw:
Leonardo Sandovalffaee982021-11-11 10:27:57 -060095 - tf-a-static-checks/postbuild.groovy