blob: 6c743a8a75f8bc6132f45c68c128261436270e79 [file] [log] [blame]
Renato Golinbdbe5552017-05-28 13:27:35 +01001- job:
2 name: tcwg-llvm-precommit
3 project-type: matrix
4 defaults: global
5 properties:
6 - authorization:
7 anonymous:
8 - job-read
9 - job-extended-read
Benjamin Copeland9dc2eb82022-10-11 12:40:33 +010010 everyone-flat:
Renato Golinbdbe5552017-05-28 13:27:35 +010011 - job-build
12 - job-cancel
13 - build-discarder:
14 days-to-keep: 10
15 num-to-keep: 10
16 parameters:
17 - choice:
18 name: build_type
19 choices:
20 - Release
21 - RelWithDebInfo
22 - Debug
23 - MinSizeRel
24 default: 'Release'
25 description: 'Release, RelWithDebInfo, Debug, MinSizeRel'
26 - string:
27 name: cmake_flags
28 default: ''
29 description: 'Additional CMake flags, ex. CMAKE_CXX_FLAGS, etc.'
30 - bool:
31 name: twostage
32 default: false
33 description: 'Whether or not to trigger a second stage with this build.'
34 - bool:
35 name: testsuite
36 default: false
37 description: 'Whether or not to trigger a test-suite with this build.'
38 - choice:
39 name: compiler
40 choices:
41 - clang
42 - gcc
43 default: 'clang'
44 description: 'Override the default system compiler.'
45 - string:
46 name: branch
47 default: ''
48 description: 'Which branch to validate (should not be master).'
Diana Picusd3765382017-07-26 15:43:09 +020049 - string:
50 name: scripts_branch
Diana Picus4cf376a2019-02-28 13:32:17 +010051 default: 'refs/remotes/origin/tested'
Diana Picusd3765382017-07-26 15:43:09 +020052 description: 'Branch to pull jenkins-script from'
Renato Golinbdbe5552017-05-28 13:27:35 +010053 disabled: false
54 node: tcwg-coordinator
55 retry-count: 3
56 concurrent: true
57 display-name: 'TCWG LLVM Pre-Commit'
58 scm:
59 - git:
Laurent Alfonsi3c7c10a2025-04-17 17:04:51 +020060 url: https://gitlab.com/Linaro/tcwg/jenkins-scripts.git
Diana Picus8a3613b2017-07-28 11:36:34 +020061 refspec: +refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*
Renato Golinbdbe5552017-05-28 13:27:35 +010062 name: origin
63 branches:
Diana Picusd3765382017-07-26 15:43:09 +020064 - ${scripts_branch}
Renato Golinbdbe5552017-05-28 13:27:35 +010065 skip-tag: true
66 shallow-clone: true
67 wipe-workspace: true
68 axes:
69 - axis:
70 type: slave
71 name: label
72 values:
73 - tcwg-x86_64-cam
74 - tcwg-tk1_32-build
75 - tcwg-apm_64-build
76 execution-strategy:
77 sequential: false
78 wrappers:
79 - timeout:
80 timeout: 300
81 - timestamps
82 - ssh-agent-credentials:
83 # tcwg-buildslave user id
84 users:
85 - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
86 - build-name:
87 name: '#${BUILD_NUMBER}-${GIT_REVISION,length=8}'
88 builders:
89 - shell: |
90 #!/bin/bash
91 set -ex
92
93 # We should not need to pre-commit validate master/empty
Renato Golinbfffac22017-05-30 13:44:50 +010094 if [ "${branch:+set}" != "set" ] || [ "${branch}" = "master" ]; then
Renato Golinbdbe5552017-05-28 13:27:35 +010095 echo "ERROR: Branch not set or set to master. Cannot validate."
96 exit 1
97 fi
98
99 # Default values, only add them to parameters if really needed
Christophe Lyon3deb1192019-10-17 11:10:33 +0000100 repository="https://git.linaro.org/toolchain/llvm"
Maxim Kuvyrkove34c20c2021-03-11 13:39:07 +0000101 build_container_tag="lts"
Renato Golinbdbe5552017-05-28 13:27:35 +0100102
103 # Find projects from branch
Renato Golin01049ef2017-05-30 13:46:46 +0100104 . "${WORKSPACE}/tcwg-llvm-common.sh"
Renato Golinbdbe5552017-05-28 13:27:35 +0100105 projects="$(list_branch_projects ${branch})"
106
107 # TODO: Find revision, to start the base job on master
108
109 # Setup job parameters (in staged build order)
110 cat << EOF > llvm.params.precommit
Renato Golinf804f572017-05-30 14:01:00 +0100111 build_type=${build_type}
112 cmake_flags=${cmake_flags}
113 build_container_tag=${build_container_tag}
114 twostage=${twostage}
115 testsuite=${testsuite}
116 compiler=${compiler}
117 repository=${repository}
118 projects=${projects}
119 branch=${branch}
120 target_list=${label}
Renato Golinbdbe5552017-05-28 13:27:35 +0100121 EOF
122
123 - conditional-step:
124 condition-kind: file-exists
125 condition-filename: llvm.params.precommit
126 steps:
127 - trigger-builds:
128 - project: 'tcwg-llvm-staged-build'
129 property-file: llvm.params.precommit
130 current-parameters: true
131 block: true