From eeb1eded7a817ae88cbc1388ea0e27a9232c0272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Mon, 6 Oct 2025 00:38:53 +0200 Subject: [PATCH] chore: split 'Build and Test' stages --- Jenkinsfile | 12 +++++++++--- build.ps1 | 18 ++++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b6ada41b8..281958ec9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -91,14 +91,20 @@ def parallelStages = [failFast: false] } } } else { - stage('Build and Test') { - // ci.jenkins.io builds (e.g. no publication) + // ci.jenkins.io builds (e.g. no publication) + stage('Build') { if (isUnix()) { sh './build.sh' + } else { + powershell '& ./build.ps1 build' + archiveArtifacts artifacts: 'build-windows_*.yaml', allowEmptyArchive: true + } + } + stage('Test') { + if (isUnix()) { sh './build.sh test' } else { powershell '& ./build.ps1 test' - archiveArtifacts artifacts: 'build-windows_*.yaml', allowEmptyArchive: true } junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results*.xml') } diff --git a/build.ps1 b/build.ps1 index e6c4c8ccf..e32a2098f 100644 --- a/build.ps1 +++ b/build.ps1 @@ -189,15 +189,17 @@ foreach($agentType in $AgentTypes) { Write-Host '= PREPARE: List of images and tags to be processed:' Invoke-Expression "$baseDockerCmd config" - Write-Host '= BUILD: Building all images...' - switch ($DryRun) { - $true { Write-Host "(dry-run) $baseDockerBuildCmd" } - $false { Invoke-Expression $baseDockerBuildCmd } - } - Write-Host '= BUILD: Finished building all images.' + if ($target -eq 'build') { + Write-Host '= BUILD: Building all images...' + switch ($DryRun) { + $true { Write-Host "(dry-run) $baseDockerBuildCmd" } + $false { Invoke-Expression $baseDockerBuildCmd } + } + Write-Host '= BUILD: Finished building all images.' - if ($lastExitCode -ne 0) { - exit $lastExitCode + if ($lastExitCode -ne 0) { + exit $lastExitCode + } } if ($target -eq 'test') {