blob: 4912ef679c6d9817532c98deeaef83fbd4cd6662 [file] [log] [blame]
Leonardo Sandoval46226da2021-01-15 13:55:56 -06001- job:
2 name: tf-static-checks
3 node: docker-amd64-tf-a-bionic
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 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'
33 - choice:
34 name: REPO_UNDER_TEST
35 choices:
36 - trusted-firmware-a
37 - tf-a-tests
38 default: trusted-firmware-a
39 description: |-
40 Repository to run static checks on.
Leonardo Sandovald1b6b5a2021-09-13 12:06:26 -050041 - string:
42 name: SHARE_FOLDER
43 default: '/srv/shared/${JOB_NAME}/${BUILD_NUMBER}'
44 description: 'Folder containing shared repositories for downstream pipeline jobs'
Leonardo Sandoval46226da2021-01-15 13:55:56 -060045 wrappers:
46 - timestamps
47 - timeout:
48 timeout: 180
49 fail: true
50 builders:
Leonardo Sandovald1b6b5a2021-09-13 12:06:26 -050051 - shell:
52 !include-raw: scripts/clone.sh
Leonardo Sandoval46226da2021-01-15 13:55:56 -060053 - shell: |
54 #!/bin/bash
55 set -e
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060056 if [[ "${REPO_UNDER_TEST}" == trusted-firmware-a ]]; then
57 cat <<EOF > env.param
58 QA_SERVER_PROJECT=${JOB_NAME}
59 QA_SERVER_VERSION=${BUILD_NUMBER}
Leonardo Sandoval46226da2021-01-15 13:55:56 -060060 GERRIT_PROJECT=${TF_GERRIT_PROJECT}
61 GERRIT_BRANCH=${TF_GERRIT_BRANCH}
62 GERRIT_REFSPEC=${TF_GERRIT_REFSPEC}
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060063 TEST_GROUPS=tf-l2-scan-build
Leonardo Sandoval46226da2021-01-15 13:55:56 -060064 EOF
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060065 fi
66 cd ${WORKSPACE}/${REPO_UNDER_TEST}
Leonardo Sandoval46226da2021-01-15 13:55:56 -060067 # Executed project-related static checks: copyright presence, headers in alphabetical order,
68 # line endings, coding style and banned API.
69 IS_CONTINUOUS_INTEGRATION=1 ${WORKSPACE}/tf-a-ci-scripts/script/static-checks/static-checks.sh
Leonardo Sandoval46226da2021-01-15 13:55:56 -060070 - trigger-builds:
71 - project: tf-ci-gateway
Leonardo Sandoval9f11c922021-02-16 09:13:53 -060072 block: true
Leonardo Sandoval46226da2021-01-15 13:55:56 -060073 property-file: env.param
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060074 # Do not trigger tf-ci-gateway if env.param file does not exist,
75 # which is the case here for TF-A Tests repository
76 property-file-fail-on-missing: True
Leonardo Sandoval46226da2021-01-15 13:55:56 -060077 publishers:
78 - archive:
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060079 artifacts: '${REPO_UNDER_TEST}/static-checks.log'
Leonardo Sandoval46226da2021-01-15 13:55:56 -060080 - groovy-postbuild:
81 script:
82 !include-raw:
83 - tf-static-checks/postbuild.groovy