diff --git a/build/jenkins/pipelines/macOS.Jenkinsfile b/build/jenkins/pipelines/macOS.Jenkinsfile index 1db70f3a37..593c02cf08 100644 --- a/build/jenkins/pipelines/macOS.Jenkinsfile +++ b/build/jenkins/pipelines/macOS.Jenkinsfile @@ -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() - } } }