blob: 3d36d31a7f46acf55d5f152d6eeae942bf482140 [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 parameters:
13 - string:
14 name: TF_GERRIT_PROJECT
15 default: 'TF-A/trusted-firmware-a'
16 - string:
17 name: TF_GERRIT_BRANCH
Leonardo Sandoval3da340d2021-02-09 14:53:30 -060018 default: 'refs/heads/integration'
Leonardo Sandoval46226da2021-01-15 13:55:56 -060019 - string:
20 name: TF_GERRIT_REFSPEC
Leonardo Sandoval3da340d2021-02-09 14:53:30 -060021 default: '+refs/heads/integration:refs/remotes/origin/integration'
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060022 - 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 Awekee8801df2021-10-25 13:41:44 -050031 - string:
32 name: CI_REFSPEC
33 default: '+refs/heads/master:refs/remotes/origin/master'
Saheer Babub495f032025-01-21 23:01:11 +000034 - 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 Sandovalecbc6f42021-03-19 10:36:24 -060039 - 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 Sandovald1b6b5a2021-09-13 12:06:26 -050047 - string:
Paul Sokolovsky66aadcb2024-06-27 12:51:33 +030048 name: GERRIT_BRANCH
49 default: ''
50 - string:
Leonardo Sandovald1b6b5a2021-09-13 12:06:26 -050051 name: SHARE_FOLDER
52 default: '/srv/shared/${JOB_NAME}/${BUILD_NUMBER}'
53 description: 'Folder containing shared repositories for downstream pipeline jobs'
Leonardo Sandoval46226da2021-01-15 13:55:56 -060054 wrappers:
55 - timestamps
56 - timeout:
Paul Sokolovskyf0adb082023-10-27 08:45:55 +030057 timeout: 240
Leonardo Sandoval46226da2021-01-15 13:55:56 -060058 fail: true
59 builders:
Leonardo Sandovald1b6b5a2021-09-13 12:06:26 -050060 - shell:
61 !include-raw: scripts/clone.sh
Leonardo Sandoval46226da2021-01-15 13:55:56 -060062 - shell: |
63 #!/bin/bash
64 set -e
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060065 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 Sandoval46226da2021-01-15 13:55:56 -060069 GERRIT_PROJECT=${TF_GERRIT_PROJECT}
70 GERRIT_BRANCH=${TF_GERRIT_BRANCH}
71 GERRIT_REFSPEC=${TF_GERRIT_REFSPEC}
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060072 TEST_GROUPS=tf-l2-scan-build
Leonardo Sandoval46226da2021-01-15 13:55:56 -060073 EOF
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060074 fi
75 cd ${WORKSPACE}/${REPO_UNDER_TEST}
Leonardo Sandoval46226da2021-01-15 13:55:56 -060076 # 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 Sandoval46226da2021-01-15 13:55:56 -060079 - trigger-builds:
Leonardo Sandovalffaee982021-11-11 10:27:57 -060080 - project: tf-a-ci-gateway
Leonardo Sandoval9f11c922021-02-16 09:13:53 -060081 block: true
Leonardo Sandoval46226da2021-01-15 13:55:56 -060082 property-file: env.param
Harrison Mutai98608e62023-04-21 14:19:22 +010083 current-parameters: true
Leonardo Sandovalffaee982021-11-11 10:27:57 -060084 # Do not trigger tf-a-ci-gateway if env.param file does not exist,
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060085 # which is the case here for TF-A Tests repository
86 property-file-fail-on-missing: True
Leonardo Sandoval46226da2021-01-15 13:55:56 -060087 publishers:
88 - archive:
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060089 artifacts: '${REPO_UNDER_TEST}/static-checks.log'
Leonardo Sandoval46226da2021-01-15 13:55:56 -060090 - groovy-postbuild:
91 script:
92 !include-raw:
Leonardo Sandovalffaee982021-11-11 10:27:57 -060093 - tf-a-static-checks/postbuild.groovy