Skip to content

Commit 99209c4

Browse files
committed
Jenkinsfile: Use matrix on qt5-20.04, qt6-22.04, qt6-24.04 images
1 parent c5bfb61 commit 99209c4

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

Jenkinsfile

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
pipeline {
2-
agent any
2+
agent none
33
stages {
4-
stage('CMake Debug build') {
5-
agent {
6-
docker {
7-
image 'juzzlin/qt5-18.04:latest'
8-
args '--privileged -t -v $WORKSPACE:/SimpleLogger'
4+
stage('Matrix Build') {
5+
matrix {
6+
axes {
7+
axis {
8+
name 'IMAGE'
9+
values 'qt5-20.04', 'qt6-22.04', 'qt6-24.04'
10+
}
11+
axis {
12+
name 'BUILD_TYPE'
13+
values 'Debug', 'Release'
14+
}
915
}
10-
}
11-
steps {
12-
sh "mkdir -p build-debug"
13-
sh "cd build-debug && cmake -DCMAKE_BUILD_TYPE=Debug .."
14-
sh "cd build-debug && cmake --build . --target all -- -j3 && ctest"
15-
}
16-
}
17-
stage('CMake Release build') {
18-
agent {
19-
docker {
20-
image 'juzzlin/qt5-18.04:latest'
21-
args '--privileged -t -v $WORKSPACE:/SimpleLogger'
16+
stages {
17+
stage('Build and Test') {
18+
agent any
19+
steps {
20+
script {
21+
docker.image("juzzlin/${IMAGE}:latest").inside('--privileged -t -v $WORKSPACE:/Argengine') {
22+
def buildDir = "build-${BUILD_TYPE.toLowerCase()}-${IMAGE}"
23+
sh "mkdir -p ${buildDir}"
24+
sh "cd ${buildDir} && cmake -GNinja -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .."
25+
sh "cd ${buildDir} && cmake --build . && ctest"
26+
}
27+
}
28+
}
29+
}
2230
}
2331
}
24-
steps {
25-
sh "mkdir -p build-release"
26-
sh "cd build-release && cmake -DCMAKE_BUILD_TYPE=Release .."
27-
sh "cd build-release && cmake --build . --target all -- -j3 && ctest"
28-
}
2932
}
3033
}
3134
}

0 commit comments

Comments
 (0)