Renato Golin | bdbe555 | 2017-05-28 13:27:35 +0100 | [diff] [blame] | 1 | - 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 Copeland | 9dc2eb8 | 2022-10-11 12:40:33 +0100 | [diff] [blame] | 10 | everyone-flat: |
Renato Golin | bdbe555 | 2017-05-28 13:27:35 +0100 | [diff] [blame] | 11 | - 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 Picus | d376538 | 2017-07-26 15:43:09 +0200 | [diff] [blame] | 49 | - string: |
| 50 | name: scripts_branch |
Diana Picus | 4cf376a | 2019-02-28 13:32:17 +0100 | [diff] [blame] | 51 | default: 'refs/remotes/origin/tested' |
Diana Picus | d376538 | 2017-07-26 15:43:09 +0200 | [diff] [blame] | 52 | description: 'Branch to pull jenkins-script from' |
Renato Golin | bdbe555 | 2017-05-28 13:27:35 +0100 | [diff] [blame] | 53 | 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 Alfonsi | 3c7c10a | 2025-04-17 17:04:51 +0200 | [diff] [blame] | 60 | url: https://gitlab.com/Linaro/tcwg/jenkins-scripts.git |
Diana Picus | 8a3613b | 2017-07-28 11:36:34 +0200 | [diff] [blame] | 61 | refspec: +refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/* |
Renato Golin | bdbe555 | 2017-05-28 13:27:35 +0100 | [diff] [blame] | 62 | name: origin |
| 63 | branches: |
Diana Picus | d376538 | 2017-07-26 15:43:09 +0200 | [diff] [blame] | 64 | - ${scripts_branch} |
Renato Golin | bdbe555 | 2017-05-28 13:27:35 +0100 | [diff] [blame] | 65 | 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 Golin | bfffac2 | 2017-05-30 13:44:50 +0100 | [diff] [blame] | 94 | if [ "${branch:+set}" != "set" ] || [ "${branch}" = "master" ]; then |
Renato Golin | bdbe555 | 2017-05-28 13:27:35 +0100 | [diff] [blame] | 95 | 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 Lyon | 3deb119 | 2019-10-17 11:10:33 +0000 | [diff] [blame] | 100 | repository="https://git.linaro.org/toolchain/llvm" |
Maxim Kuvyrkov | e34c20c | 2021-03-11 13:39:07 +0000 | [diff] [blame] | 101 | build_container_tag="lts" |
Renato Golin | bdbe555 | 2017-05-28 13:27:35 +0100 | [diff] [blame] | 102 | |
| 103 | # Find projects from branch |
Renato Golin | 01049ef | 2017-05-30 13:46:46 +0100 | [diff] [blame] | 104 | . "${WORKSPACE}/tcwg-llvm-common.sh" |
Renato Golin | bdbe555 | 2017-05-28 13:27:35 +0100 | [diff] [blame] | 105 | 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 Golin | f804f57 | 2017-05-30 14:01:00 +0100 | [diff] [blame] | 111 | 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 Golin | bdbe555 | 2017-05-28 13:27:35 +0100 | [diff] [blame] | 121 | 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 |