1
0
forked from mirrors/0ad

Retry non-incremental CI builds as a new run

When a non-incremental build is needed for a PR, the current code cleans
up workspaces and retries, but this leaves the build error in the
console output. This marks the build as unstable, as if warnings were
present.

Instead, let the build fail and instead reschedule a clean build, which
will override the build status in Gitea.
This commit is contained in:
Itms
2024-11-10 13:14:25 +01:00
parent 6582e7348e
commit ebd66fef89
4 changed files with 108 additions and 59 deletions
+21 -8
View File
@@ -22,6 +22,10 @@ pipeline {
// Stop previous build in pull requests, but not in branches
options { disableConcurrentBuilds(abortPrevious: env.CHANGE_ID != null) }
parameters {
booleanParam description: 'Non-incremental build', name: 'CLEANBUILD'
}
agent {
node {
label 'FreeBSDAgent'
@@ -44,6 +48,12 @@ pipeline {
sh "libraries/build-source-libs.sh 2> freebsd-prebuild-errors.log"
sh "build/workspaces/update-workspaces.sh --jenkins-tests 2>> freebsd-prebuild-errors.log"
script {
if (params.CLEANBUILD) {
sh "cd build/workspaces/gcc/ && gmake clean config=release"
}
}
}
post {
failure {
@@ -54,16 +64,19 @@ pipeline {
stage ("Release Build") {
steps {
retry (2) {
script {
try { sh "cd build/workspaces/gcc/ && gmake config=release" }
catch(e) {
sh "cd build/workspaces/gcc/ && gmake clean config=release"
throw e
}
}
sh "cd build/workspaces/gcc/ && gmake config=release"
}
post {
failure {
script { if (!params.CLEANBUILD) {
build wait: false, job: "$JOB_NAME", parameters: [booleanParam(name: 'CLEANBUILD', value: true)]
}}
}
}
}
stage ("Release Tests") {
steps {
timeout(time: 15) {
sh "cd binaries/system/ && ./test > cxxtest-release.xml"
}
+29 -17
View File
@@ -21,6 +21,10 @@ pipeline {
// Stop previous build in pull requests, but not in branches
options { disableConcurrentBuilds(abortPrevious: env.CHANGE_ID != null) }
parameters {
booleanParam description: 'Non-incremental build', name: 'CLEANBUILD'
}
agent none
stages {
stage("Setup") {
@@ -74,6 +78,13 @@ pipeline {
sh "build/workspaces/update-workspaces.sh --jenkins-tests 2>> ${JENKINS_COMPILER}-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"
}
}
}
post {
failure {
@@ -84,15 +95,19 @@ pipeline {
stage("Debug Build") {
steps {
retry(2) {
script {
try { sh "cd build/workspaces/gcc/ && make config=debug" }
catch(e) {
sh "cd build/workspaces/gcc/ && make clean config=debug"
throw e
}
}
sh "cd build/workspaces/gcc/ && make config=debug"
}
post {
failure {
script { if (!params.CLEANBUILD) {
build wait: false, job: "$JOB_NAME", parameters: [booleanParam(name: 'CLEANBUILD', value: true)]
}}
}
}
}
stage("Debug Tests") {
steps {
timeout(time: 15) {
sh "cd binaries/system/ && ./test_dbg > cxxtest-debug.xml"
}
@@ -106,15 +121,12 @@ pipeline {
stage("Release Build") {
steps {
retry(2) {
script {
try { sh "cd build/workspaces/gcc/ && make config=release" }
catch(e) {
sh "cd build/workspaces/gcc/ && make clean config=release"
throw e
}
}
}
sh "cd build/workspaces/gcc/ && make config=release"
}
}
stage("Release Tests") {
steps {
timeout(time: 15) {
sh "cd binaries/system/ && ./test > cxxtest-release.xml"
}
+29 -17
View File
@@ -21,6 +21,10 @@ pipeline {
// Stop previous build in pull requests, but not in branches
options { disableConcurrentBuilds(abortPrevious: env.CHANGE_ID != null) }
parameters {
booleanParam description: 'Non-incremental build', name: 'CLEANBUILD'
}
agent {
node {
label 'macOSAgent'
@@ -38,6 +42,13 @@ pipeline {
sh "libraries/build-macos-libs.sh 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"
}
}
}
post {
failure {
@@ -48,15 +59,19 @@ pipeline {
stage("Debug Build") {
steps {
retry(2) {
script {
try { sh "cd build/workspaces/gcc/ && make config=debug" }
catch(e) {
sh "cd build/workspaces/gcc/ && make clean config=debug"
throw e
}
}
sh "cd build/workspaces/gcc/ && make config=debug"
}
post {
failure {
script { if (!params.CLEANBUILD) {
build wait: false, job: "$JOB_NAME", parameters: [booleanParam(name: 'CLEANBUILD', value: true)]
}}
}
}
}
stage("Debug Tests") {
steps {
timeout(time: 15) {
sh "cd binaries/system/ && ./test_dbg > cxxtest-debug.xml"
}
@@ -70,15 +85,12 @@ pipeline {
stage("Release Build") {
steps {
retry(2) {
script {
try { sh "cd build/workspaces/gcc/ && make config=release" }
catch(e) {
sh "cd build/workspaces/gcc/ && make clean config=release"
throw e
}
}
}
sh "cd build/workspaces/gcc/ && make config=release"
}
}
stage("Release Tests") {
steps {
timeout(time: 15) {
sh "cd binaries/system/ && ./test > cxxtest-release.xml"
}
+29 -17
View File
@@ -24,6 +24,10 @@ pipeline {
// Stop previous build in pull requests, but not in branches
options { disableConcurrentBuilds(abortPrevious: env.CHANGE_ID != null) }
parameters {
booleanParam description: 'Non-incremental build', name: 'CLEANBUILD'
}
agent {
node {
label 'WindowsAgent'
@@ -43,20 +47,31 @@ pipeline {
bat "(robocopy /MIR /NDL /NJH /NJS /NP /NS /NC E:\\wxWidgets-3.2.6\\lib libraries\\win32\\wxwidgets\\lib) ^& IF %ERRORLEVEL% LEQ 1 exit 0"
bat "(robocopy /MIR /NDL /NJH /NJS /NP /NS /NC E:\\wxWidgets-3.2.6\\include libraries\\win32\\wxwidgets\\include) ^& IF %ERRORLEVEL% LEQ 1 exit 0"
bat "cd build\\workspaces && update-workspaces.bat --atlas --jenkins-tests"
script {
if (params.CLEANBUILD) {
bat "cd build\\workspaces\\vs2017 && ${visualStudioPath} pyrogenesis.sln /p:Configuration=Debug /t:Clean"
bat "cd build\\workspaces\\vs2017 && ${visualStudioPath} pyrogenesis.sln /p:Configuration=Release /t:Clean"
}
}
}
}
stage("Debug Build") {
steps {
retry(2) {
script {
try { bat("cd build\\workspaces\\vs2017 && ${visualStudioPath} pyrogenesis.sln /p:Configuration=Debug ${buildOptions}") }
catch(e) {
bat("cd build\\workspaces\\vs2017 && ${visualStudioPath} pyrogenesis.sln /p:Configuration=Debug /t:Clean")
throw e
}
}
bat "cd build\\workspaces\\vs2017 && ${visualStudioPath} pyrogenesis.sln /p:Configuration=Debug ${buildOptions}"
}
post {
failure {
script { if (!params.CLEANBUILD) {
build wait: false, job: "$JOB_NAME", parameters: [booleanParam(name: 'CLEANBUILD', value: true)]
}}
}
}
}
stage("Debug Tests") {
steps {
timeout(time: 15) {
bat "cd binaries\\system && test_dbg.exe > cxxtest-debug.xml"
}
@@ -70,15 +85,12 @@ pipeline {
stage ("Release Build") {
steps {
retry(2) {
script {
try { bat("cd build\\workspaces\\vs2017 && ${visualStudioPath} pyrogenesis.sln /p:Configuration=Release ${buildOptions}") }
catch(e) {
bat("cd build\\workspaces\\vs2017 && ${visualStudioPath} pyrogenesis.sln /p:Configuration=Release /t:Clean")
throw e
}
}
}
bat "cd build\\workspaces\\vs2017 && ${visualStudioPath} pyrogenesis.sln /p:Configuration=Release ${buildOptions}"
}
}
stage ("Release Tests") {
steps {
timeout(time: 5) {
bat "cd binaries\\system && test.exe > cxxtest-release.xml"
}