blob: 2bf1ea926817ab436d22d958116c3ea17c2ddfc6 [file] [log] [blame]
#!/usr/bin/env groovy
pipeline {
agent { label 'green-dragon-23' }
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 PATH=$PATH:/usr/bin:/usr/local/bin
# Running too many asanified threads is too stressful for the kernel and we get >90% system time.
export MAX_PARALLEL_TESTS=$(sysctl hw.physicalcpu |awk '{print int(($2+1)/2)}')
python llvm-zorg/zorg/jenkins/monorepo_build.py lldb-cmake-sanitized build \
--assertions \
--projects="clang;libcxx;libcxxabi;lld;lldb" \
--cmake-type=Release
'''
}
}
}
stage('Test') {
steps {
timeout(120) {
sh '''
set -u
export PATH=$PATH:/usr/bin:/usr/local/bin
rm -rf test/results.xml
python llvm-zorg/zorg/jenkins/monorepo_build.py lldb-cmake-sanitized test
'''
}
}
}
}
post {
always {
scanForIssues tool: clang()
junit 'test/results.xml'
}
}
}