blob: cf41a6aa6e573262fee9f1229989ab5abd7bb24a [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'
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060036 - choice:
37 name: REPO_UNDER_TEST
38 choices:
39 - trusted-firmware-a
40 - tf-a-tests
41 default: trusted-firmware-a
42 description: |-
43 Repository to run static checks on.
Leonardo Sandovald1b6b5a2021-09-13 12:06:26 -050044 - string:
Paul Sokolovsky66aadcb2024-06-27 12:51:33 +030045 name: GERRIT_BRANCH
46 default: ''
47 - string:
Leonardo Sandovald1b6b5a2021-09-13 12:06:26 -050048 name: SHARE_FOLDER
49 default: '/srv/shared/${JOB_NAME}/${BUILD_NUMBER}'
50 description: 'Folder containing shared repositories for downstream pipeline jobs'
Leonardo Sandoval46226da2021-01-15 13:55:56 -060051 wrappers:
52 - timestamps
53 - timeout:
Paul Sokolovskyf0adb082023-10-27 08:45:55 +030054 timeout: 240
Leonardo Sandoval46226da2021-01-15 13:55:56 -060055 fail: true
56 builders:
Leonardo Sandovald1b6b5a2021-09-13 12:06:26 -050057 - shell:
58 !include-raw: scripts/clone.sh
Leonardo Sandoval46226da2021-01-15 13:55:56 -060059 - shell: |
60 #!/bin/bash
61 set -e
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060062 if [[ "${REPO_UNDER_TEST}" == trusted-firmware-a ]]; then
63 cat <<EOF > env.param
64 QA_SERVER_PROJECT=${JOB_NAME}
65 QA_SERVER_VERSION=${BUILD_NUMBER}
Leonardo Sandoval46226da2021-01-15 13:55:56 -060066 GERRIT_PROJECT=${TF_GERRIT_PROJECT}
67 GERRIT_BRANCH=${TF_GERRIT_BRANCH}
68 GERRIT_REFSPEC=${TF_GERRIT_REFSPEC}
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060069 TEST_GROUPS=tf-l2-scan-build
Leonardo Sandoval46226da2021-01-15 13:55:56 -060070 EOF
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060071 fi
72 cd ${WORKSPACE}/${REPO_UNDER_TEST}
Leonardo Sandoval46226da2021-01-15 13:55:56 -060073 # Executed project-related static checks: copyright presence, headers in alphabetical order,
74 # line endings, coding style and banned API.
75 IS_CONTINUOUS_INTEGRATION=1 ${WORKSPACE}/tf-a-ci-scripts/script/static-checks/static-checks.sh
Leonardo Sandoval46226da2021-01-15 13:55:56 -060076 - trigger-builds:
Leonardo Sandovalffaee982021-11-11 10:27:57 -060077 - project: tf-a-ci-gateway
Leonardo Sandoval9f11c922021-02-16 09:13:53 -060078 block: true
Leonardo Sandoval46226da2021-01-15 13:55:56 -060079 property-file: env.param
Harrison Mutai98608e62023-04-21 14:19:22 +010080 current-parameters: true
Leonardo Sandovalffaee982021-11-11 10:27:57 -060081 # Do not trigger tf-a-ci-gateway if env.param file does not exist,
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060082 # which is the case here for TF-A Tests repository
83 property-file-fail-on-missing: True
Leonardo Sandoval46226da2021-01-15 13:55:56 -060084 publishers:
85 - archive:
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060086 artifacts: '${REPO_UNDER_TEST}/static-checks.log'
Leonardo Sandoval46226da2021-01-15 13:55:56 -060087 - groovy-postbuild:
88 script:
89 !include-raw:
Leonardo Sandovalffaee982021-11-11 10:27:57 -060090 - tf-a-static-checks/postbuild.groovy