1
0
forked from 0ad/0ad

Automatically try to unbreak CI incremental builds

This entirely reverts ee3318309b and removes the [CLEANBUILD] feature,
which needed to be used without omission to be efficient.

Instead, in case of build failure, the CI automatically starts a
non-incremental second build by running `make clean` (or the MSBuild
equivalent) before retrying the build.
This commit is contained in:
Nicolas Auvray 2024-08-31 15:44:11 +02:00 committed by Nicolas Auvray
parent bcf97b608b
commit 79127ec59d
4 changed files with 63 additions and 75 deletions

View File

@ -35,16 +35,6 @@ pipeline {
LLVM_OBJDUMP = '/usr/bin/llvm-objdump'
}
stages {
stage("Cleanup") {
when {
changelog '.*\\[CLEANBUILD\\].*'
}
steps {
script { env.CLEANBUILD = 'true' }
sh "git clean -fdx build/ source/"
}
}
stage ("Pre-build") {
steps {
discoverGitReferenceBuild()
@ -64,7 +54,15 @@ pipeline {
stage ("Release Build") {
steps {
sh "cd build/workspaces/gcc/ && gmake -j2 config=release"
retry (2) {
script {
try { sh "cd build/workspaces/gcc/ && gmake -j2 config=release" }
catch(e) {
sh "cd build/workspaces/gcc/ && gmake clean config=release"
throw e
}
}
}
timeout(time: 15) {
sh "cd binaries/system/ && ./test > cxxtest-release.xml"
@ -80,11 +78,6 @@ pipeline {
post {
always {
script {
if (env.CLEANBUILD == 'true') {
sh "git clean -fdx build/ source/"
}
}
recordIssues enabledForFailure: true, qualityGates: [[threshold: 1, type: 'NEW']], tool: clang()
}
}

View File

@ -60,19 +60,6 @@ pipeline {
}
stages {
stage("Cleanup") {
when {
allOf {
environment name: 'JENKINS_PCH', value: 'pch'
changelog '.*\\[CLEANBUILD\\].*'
}
}
steps {
script { env.CLEANBUILD = 'true' }
sh "git clean -fdx build/ source/"
}
}
stage("Pre-build") {
steps {
sh "git lfs pull -I binaries/data/tests"
@ -97,7 +84,15 @@ pipeline {
stage("Debug Build") {
steps {
sh "cd build/workspaces/gcc/ && make -j1 config=debug"
retry(2) {
script {
try { sh "cd build/workspaces/gcc/ && make -j1 config=debug" }
catch(e) {
sh "cd build/workspaces/gcc/ && make clean config=debug"
throw e
}
}
}
timeout(time: 15) {
sh "cd binaries/system/ && ./test_dbg > cxxtest-debug.xml"
}
@ -111,7 +106,15 @@ pipeline {
stage("Release Build") {
steps {
sh "cd build/workspaces/gcc/ && make -j1 config=release"
retry(2) {
script {
try { sh "cd build/workspaces/gcc/ && make -j1 config=release" }
catch(e) {
sh "cd build/workspaces/gcc/ && make clean config=release"
throw e
}
}
}
timeout(time: 15) {
sh "cd binaries/system/ && ./test > cxxtest-release.xml"
}
@ -123,16 +126,6 @@ pipeline {
}
}
}
post {
always {
script {
if (env.CLEANBUILD == 'true' && env.JENKINS_PCH == 'pch') {
sh "git clean -fdx build/ source/"
}
}
}
}
}
post {

View File

@ -29,16 +29,6 @@ pipeline {
}
stages {
stage("Cleanup") {
when {
changelog '.*\\[CLEANBUILD\\].*'
}
steps {
script { env.CLEANBUILD = 'true' }
sh "git clean -fdx build/ source/"
}
}
stage ("Pre-build") {
steps {
discoverGitReferenceBuild()
@ -58,7 +48,15 @@ pipeline {
stage("Debug Build") {
steps {
sh "cd build/workspaces/gcc/ && make -j4 config=debug"
retry(2) {
script {
try { sh "cd build/workspaces/gcc/ && make -j4 config=debug" }
catch(e) {
sh "cd build/workspaces/gcc/ && make clean config=debug"
throw e
}
}
}
timeout(time: 15) {
sh "cd binaries/system/ && ./test_dbg > cxxtest-debug.xml"
}
@ -72,7 +70,15 @@ pipeline {
stage("Release Build") {
steps {
sh "cd build/workspaces/gcc/ && make -j4 config=release"
retry(2) {
script {
try { sh "cd build/workspaces/gcc/ && make -j4 config=release" }
catch(e) {
sh "cd build/workspaces/gcc/ && make clean config=release"
throw e
}
}
}
timeout(time: 15) {
sh "cd binaries/system/ && ./test > cxxtest-release.xml"
}
@ -87,11 +93,6 @@ pipeline {
post {
always {
script {
if (env.CLEANBUILD == 'true') {
sh "git clean -fdx build/ source/"
}
}
recordIssues enabledForFailure: true, qualityGates: [[threshold: 1, type: 'NEW']], tool: clang()
}
}

View File

@ -32,16 +32,6 @@ pipeline {
}
stages {
stage("Cleanup") {
when {
changelog '.*\\[CLEANBUILD\\].*'
}
steps {
script { env.CLEANBUILD = 'true' }
bat "git clean -fdx build/ source/"
}
}
stage ("Pre-build") {
steps {
discoverGitReferenceBuild()
@ -58,7 +48,15 @@ pipeline {
stage("Debug Build") {
steps {
bat("cd build\\workspaces\\vs2017 && ${visualStudioPath} pyrogenesis.sln /p:Configuration=Debug ${buildOptions}")
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
}
}
}
timeout(time: 15) {
bat "cd binaries\\system && test_dbg.exe > cxxtest-debug.xml"
}
@ -72,7 +70,15 @@ pipeline {
stage ("Release Build") {
steps {
bat("cd build\\workspaces\\vs2017 && ${visualStudioPath} pyrogenesis.sln /p:Configuration=Release ${buildOptions}")
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
}
}
}
timeout(time: 5) {
bat "cd binaries\\system && test.exe > cxxtest-release.xml"
}
@ -87,11 +93,6 @@ pipeline {
post {
always {
script {
if (env.CLEANBUILD == 'true') {
bat "git clean -fdx build/ source/"
}
}
recordIssues enabledForFailure: true, qualityGates: [[threshold: 1, type: 'NEW']], tool: msBuild()
}
}