Update MacOS Jenkins pipline

Make use of build matrix, drop reference build as it makes no sense for
incremental builds, fix warnings in test reporting and finally log build
warnings per run which prevents third partly library builds to leak into
the report and failing the CI.

Ref: #7367
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2025-06-21 18:00:18 +02:00
parent 256dff7fd4
commit b2e379b841
No known key found for this signature in database

View file

@ -25,89 +25,106 @@ pipeline {
booleanParam description: 'Non-incremental build', name: 'CLEANBUILD'
}
agent {
node {
label 'macOSAgentVentura'
customWorkspace 'workspace/clang13'
}
}
agent none
stages {
stage('Pre-build') {
steps {
discoverGitReferenceBuild()
sh 'git lfs pull -I binaries/data/tests'
sh 'git lfs pull -I "binaries/data/mods/_test.*"'
sh "libraries/build-macos-libs.sh ${JOBS} 2> macos-prebuild-errors.log"
sh 'build/workspaces/update-workspaces.sh --jenkins-tests 2>> macos-prebuild-errors.log'
script {
if (params.CLEANBUILD) {
sh 'cd build/workspaces/gcc/ && make clean config=debug'
sh 'cd build/workspaces/gcc/ && make clean config=release'
stage('macOS builds') {
matrix {
axes {
axis {
name 'BUILD_TYPE'
values 'debug', 'release'
}
}
}
post {
failure {
echo(message: readFile(file: 'macos-prebuild-errors.log'))
}
}
}
stage('Debug Build') {
steps {
sh "cd build/workspaces/gcc/ && make ${JOBS} config=debug"
}
post {
failure {
script {
if (!params.CLEANBUILD) {
build wait: false, job: "$JOB_NAME", parameters: [booleanParam(name: 'CLEANBUILD', value: true)]
stages {
stage('Run') {
agent {
node {
label 'macOSAgentVentura'
customWorkspace 'workspace/clang13'
}
}
stages {
stage('Pre-build') {
steps {
sh 'git lfs pull -I binaries/data/tests'
sh 'git lfs pull -I "binaries/data/mods/_test.*"'
sh "libraries/build-macos-libs.sh ${JOBS} 2> macos-prebuild-errors.log"
sh 'build/workspaces/update-workspaces.sh --jenkins-tests 2>> macos-prebuild-errors.log'
script {
if (params.CLEANBUILD) {
sh 'make -C build/workspaces/gcc config=${BUILD_TYPE} clean'
}
}
}
post {
failure {
echo(message: readFile(file: 'macos-prebuild-errors.log'))
}
}
}
stage('Build') {
steps {
sh '''
rm -f thepipe
mkfifo thepipe
tee build.log < thepipe &
make -C build/workspaces/gcc/ ${JOBS} config=${BUILD_TYPE} > thepipe 2>&1
status=$?
rm thepipe
exit ${status}
'''
}
post {
failure {
script {
if (!params.CLEANBUILD) {
build wait: false, job: "$JOB_NAME", parameters: [booleanParam(name: 'CLEANBUILD', value: true)]
}
}
}
always {
script {
recordIssues(
tool: analysisParser(
analysisModelId: 'clang',
name: env.BUILD_TYPE,
id : env.BUILD_TYPE,
pattern: 'build.log'
),
skipPublishingChecks: true,
enabledForFailure: true,
qualityGates: [[threshold: 1, type: 'TOTAL', criticality: 'FAILURE']]
)
}
}
}
}
stage('Tests') {
steps {
timeout(time: 15) {
script {
def bin = env.BUILD_TYPE == 'debug' ? 'test_dbg' : 'test'
sh "./binaries/system/${bin} > cxxtest.xml"
}
}
}
post {
always {
junit(skipPublishingChecks: true, testResults: 'cxxtest.xml')
}
}
}
}
}
}
}
}
stage('Debug Tests') {
steps {
timeout(time: 15) {
sh 'cd binaries/system/ && ./test_dbg > cxxtest-debug.xml'
}
}
post {
always {
junit 'binaries/system/cxxtest-debug.xml'
}
}
}
stage('Release Build') {
steps {
sh "cd build/workspaces/gcc/ && make ${JOBS} config=release"
}
}
stage('Release Tests') {
steps {
timeout(time: 15) {
sh 'cd binaries/system/ && ./test > cxxtest-release.xml'
}
}
post {
always {
junit 'binaries/system/cxxtest-release.xml'
}
}
}
}
post {
always {
recordIssues enabledForFailure: true, qualityGates: [[threshold: 1, type: 'NEW']], tool: clang()
}
}
}