blob: 0c23fc96224427e0574e40c9b50e8882f2cfb0c0 [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:
45 name: SHARE_FOLDER
46 default: '/srv/shared/${JOB_NAME}/${BUILD_NUMBER}'
47 description: 'Folder containing shared repositories for downstream pipeline jobs'
Leonardo Sandoval46226da2021-01-15 13:55:56 -060048 wrappers:
49 - timestamps
50 - timeout:
Paul Sokolovskyf0adb082023-10-27 08:45:55 +030051 timeout: 240
Leonardo Sandoval46226da2021-01-15 13:55:56 -060052 fail: true
53 builders:
Leonardo Sandovald1b6b5a2021-09-13 12:06:26 -050054 - shell:
55 !include-raw: scripts/clone.sh
Leonardo Sandoval46226da2021-01-15 13:55:56 -060056 - shell: |
57 #!/bin/bash
58 set -e
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060059 if [[ "${REPO_UNDER_TEST}" == trusted-firmware-a ]]; then
60 cat <<EOF > env.param
61 QA_SERVER_PROJECT=${JOB_NAME}
62 QA_SERVER_VERSION=${BUILD_NUMBER}
Leonardo Sandoval46226da2021-01-15 13:55:56 -060063 GERRIT_PROJECT=${TF_GERRIT_PROJECT}
64 GERRIT_BRANCH=${TF_GERRIT_BRANCH}
65 GERRIT_REFSPEC=${TF_GERRIT_REFSPEC}
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060066 TEST_GROUPS=tf-l2-scan-build
Leonardo Sandoval46226da2021-01-15 13:55:56 -060067 EOF
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060068 fi
69 cd ${WORKSPACE}/${REPO_UNDER_TEST}
Leonardo Sandoval46226da2021-01-15 13:55:56 -060070 # Executed project-related static checks: copyright presence, headers in alphabetical order,
71 # line endings, coding style and banned API.
72 IS_CONTINUOUS_INTEGRATION=1 ${WORKSPACE}/tf-a-ci-scripts/script/static-checks/static-checks.sh
Leonardo Sandoval46226da2021-01-15 13:55:56 -060073 - trigger-builds:
Leonardo Sandovalffaee982021-11-11 10:27:57 -060074 - project: tf-a-ci-gateway
Leonardo Sandoval9f11c922021-02-16 09:13:53 -060075 block: true
Leonardo Sandoval46226da2021-01-15 13:55:56 -060076 property-file: env.param
Harrison Mutai98608e62023-04-21 14:19:22 +010077 current-parameters: true
Leonardo Sandovalffaee982021-11-11 10:27:57 -060078 # Do not trigger tf-a-ci-gateway if env.param file does not exist,
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060079 # which is the case here for TF-A Tests repository
80 property-file-fail-on-missing: True
Leonardo Sandoval46226da2021-01-15 13:55:56 -060081 publishers:
82 - archive:
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060083 artifacts: '${REPO_UNDER_TEST}/static-checks.log'
Leonardo Sandoval46226da2021-01-15 13:55:56 -060084 - groovy-postbuild:
85 script:
86 !include-raw:
Leonardo Sandovalffaee982021-11-11 10:27:57 -060087 - tf-a-static-checks/postbuild.groovy