blob: 5c27c0827d6d77981e25aba436b90437345b5cf8 [file] [log] [blame]
#!/usr/bin/env groovy
pipeline {
agent { label 'green-dragon-10' }
parameters {
string(name: 'GIT_REVISION', defaultValue: '*/master', description: 'Git revision to build')
string(name: 'ARTIFACT', defaultValue: 'clang-stage1-RA/latest', description: 'Compiler artifact to use for building the project')
string(name: 'BUILD_TYPE', defaultValue: 'Release', description: 'Default CMake build type; one of: Release, Debug, ...')
string(name: 'CLEAN', defaultValue: "false", description: 'Whether or not to clean the build directory before building')
}
stages {
stage('Checkout') {
steps {
timeout(30) {
dir('llvm-project') {
checkout([$class: 'GitSCM', branches: [[name: params.GIT_REVISION]], userRemoteConfigs: [[url: 'http://labmaster3.local/git/llvm-project.git']]])
}
dir('llvm-zorg') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], userRemoteConfigs: [[url: 'http://labmaster3.local/git/llvm-zorg.git']]])
}
}
}
}
stage('Fetch Host Compiler') {
steps {
timeout(10) {
sh '''
python llvm-zorg/zorg/jenkins/monorepo_build.py fetch
'''
}
}
}
stage('Build') {
steps {
timeout(120) {
sh '''
set -u
rm -rf build.properties
cd llvm-project
git tag -a -m "First Commit" first_commit 97724f18c79c7cc81ced24239eb5e883bf1398ef || true
git_desc=$(git describe --match "first_commit")
export GIT_DISTANCE=$(echo ${git_desc} | cut -f 2 -d "-")
sha=$(echo ${git_desc} | cut -f 3 -d "-")
export GIT_SHA=${sha:1}
cd -
export MAX_PARALLEL_TESTS=$(sysctl hw.physicalcpu |awk '{print $2}')
python llvm-zorg/zorg/jenkins/monorepo_build.py lldb-cmake build \
--assertions \
--projects="clang;libcxx;libcxxabi;compiler-rt;lld;lldb;debuginfo-tests" \
--compiler-flag="-Wdocumentation" \
--cmake-type=Release || (echo "Retrying. debuginfo-tests may have failed due to high load."; sleep 30; python llvm-zorg/zorg/jenkins/monorepo_build.py lldb-cmake build \
--assertions \
--projects="clang;libcxx;libcxxabi;compiler-rt;lld;lldb;debuginfo-tests" \
--compiler-flag="-Wdocumentation" \
--cmake-type=Release)
'''
}
}
}
stage('Test') {
steps {
timeout(90) {
sh '''
set -u
export PATH=$PATH:/usr/bin:/usr/local/bin
export LLDB_CAPTURE_REPRODUCER=1
rm -rf test/results.xml
export MAX_PARALLEL_TESTS=$(sysctl hw.physicalcpu |awk '{print $2}')
python llvm-zorg/zorg/jenkins/monorepo_build.py lldb-cmake testlong
'''
}
}
}
}
post {
always {
scanForIssues tool: clang()
junit 'test/results.xml'
}
changed {
emailext subject: '$DEFAULT_SUBJECT',
presendScript: '$DEFAULT_PRESEND_SCRIPT',
postsendScript: '$DEFAULT_POSTSEND_SCRIPT',
recipientProviders: [
[$class: 'CulpritsRecipientProvider'],
[$class: 'DevelopersRecipientProvider'],
[$class: 'RequesterRecipientProvider'],
],
replyTo: '$DEFAULT_REPLYTO',
to: '$DEFAULT_RECIPIENTS',
body:'$DEFAULT_CONTENT'
}
}
}