blob: 2f01de7c3021b3b1e55d0e4ee44e979e68abe2c9 [file] [log] [blame]
Leonardo Sandoval46226da2021-01-15 13:55:56 -06001- scm:
2 name: tf-a-ci-scripts
3 scm:
4 - git:
5 url: https://git.trustedfirmware.org/ci/tf-a-ci-scripts.git
6 refspec: +refs/heads/master:refs/remotes/origin/master
7 name: origin
8 branches:
9 - refs/heads/master
10 basedir: tf-a-ci-scripts
11 skip-tag: true
12 shallow-clone: true
13 wipe-workspace: false
14- scm:
15 name: trusted-firmware-a
16 scm:
17 - git:
18 url: https://review.trustedfirmware.org/${TF_GERRIT_PROJECT}
19 refspec: ${TF_GERRIT_REFSPEC}
20 name: origin
21 branches:
22 - ${TF_GERRIT_BRANCH}
23 basedir: trusted-firmware-a
24 skip-tag: true
25 shallow-clone: false
26 wipe-workspace: false
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060027- scm:
28 name: tf-a-tests
29 scm:
30 - git:
31 url: https://review.trustedfirmware.org/${TFTF_GERRIT_PROJECT}
32 refspec: ${TFTF_GERRIT_REFSPEC}
33 name: origin
34 branches:
35 - ${TFTF_GERRIT_BRANCH}
36 basedir: tf-a-tests
37 skip-tag: true
38 shallow-clone: false
39 wipe-workspace: false
Leonardo Sandoval46226da2021-01-15 13:55:56 -060040- job:
41 name: tf-static-checks
42 node: docker-amd64-tf-a-bionic
43 project-type: freestyle
44 concurrent: true
45 disabled: false
46 defaults: global
47 description: Run static checks on Git repository
48 properties:
49 - build-discarder:
Leonardo Sandovala4feb552021-03-02 12:10:21 -060050 days-to-keep: 14
Leonardo Sandoval46226da2021-01-15 13:55:56 -060051 - authorization:
Leonardo Sandovalebca8822021-01-25 18:20:04 -060052 !include: authorization.yaml.inc
Leonardo Sandoval46226da2021-01-15 13:55:56 -060053 parameters:
54 - string:
55 name: TF_GERRIT_PROJECT
56 default: 'TF-A/trusted-firmware-a'
57 - string:
58 name: TF_GERRIT_BRANCH
Leonardo Sandoval3da340d2021-02-09 14:53:30 -060059 default: 'refs/heads/integration'
Leonardo Sandoval46226da2021-01-15 13:55:56 -060060 - string:
61 name: TF_GERRIT_REFSPEC
Leonardo Sandoval3da340d2021-02-09 14:53:30 -060062 default: '+refs/heads/integration:refs/remotes/origin/integration'
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060063 - string:
64 name: TFTF_GERRIT_PROJECT
65 default: 'TF-A/tf-a-tests'
66 - string:
67 name: TFTF_GERRIT_BRANCH
68 default: 'refs/heads/master'
69 - string:
70 name: TFTF_GERRIT_REFSPEC
71 default: '+refs/heads/master:refs/remotes/origin/master'
72 - choice:
73 name: REPO_UNDER_TEST
74 choices:
75 - trusted-firmware-a
76 - tf-a-tests
77 default: trusted-firmware-a
78 description: |-
79 Repository to run static checks on.
Leonardo Sandoval46226da2021-01-15 13:55:56 -060080 scm:
81 - tf-a-ci-scripts
82 - trusted-firmware-a
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060083 - tf-a-tests
Leonardo Sandoval46226da2021-01-15 13:55:56 -060084 wrappers:
85 - timestamps
86 - timeout:
87 timeout: 180
88 fail: true
89 builders:
90 - shell: |
91 #!/bin/bash
92 set -e
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -060093 if [[ "${REPO_UNDER_TEST}" == trusted-firmware-a ]]; then
94 cat <<EOF > env.param
95 QA_SERVER_PROJECT=${JOB_NAME}
96 QA_SERVER_VERSION=${BUILD_NUMBER}
Leonardo Sandoval46226da2021-01-15 13:55:56 -060097 GERRIT_PROJECT=${TF_GERRIT_PROJECT}
98 GERRIT_BRANCH=${TF_GERRIT_BRANCH}
99 GERRIT_REFSPEC=${TF_GERRIT_REFSPEC}
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -0600100 TEST_GROUPS=tf-l2-scan-build
Leonardo Sandoval46226da2021-01-15 13:55:56 -0600101 EOF
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -0600102 fi
103 cd ${WORKSPACE}/${REPO_UNDER_TEST}
Leonardo Sandoval46226da2021-01-15 13:55:56 -0600104 # Executed project-related static checks: copyright presence, headers in alphabetical order,
105 # line endings, coding style and banned API.
106 IS_CONTINUOUS_INTEGRATION=1 ${WORKSPACE}/tf-a-ci-scripts/script/static-checks/static-checks.sh
Leonardo Sandoval46226da2021-01-15 13:55:56 -0600107 - trigger-builds:
108 - project: tf-ci-gateway
Leonardo Sandoval9f11c922021-02-16 09:13:53 -0600109 block: true
Leonardo Sandoval46226da2021-01-15 13:55:56 -0600110 property-file: env.param
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -0600111 # Do not trigger tf-ci-gateway if env.param file does not exist,
112 # which is the case here for TF-A Tests repository
113 property-file-fail-on-missing: True
Leonardo Sandoval46226da2021-01-15 13:55:56 -0600114 publishers:
115 - archive:
Leonardo Sandovalecbc6f42021-03-19 10:36:24 -0600116 artifacts: '${REPO_UNDER_TEST}/static-checks.log'
Leonardo Sandoval46226da2021-01-15 13:55:56 -0600117 - groovy-postbuild:
118 script:
119 !include-raw:
120 - tf-static-checks/postbuild.groovy