Files
qt-migration-legatus/Jenkinsfile
T
2026-09-12 13:54:34 +02:00

107 lines
2.9 KiB
Groovy

pipeline {
agent {
docker {
// Unified build image, built from ci/Dockerfile.ci:
// docker build -f ci/Dockerfile.ci -t legatus-build:26.04 ci
// Push it to the registry the Jenkins agents pull from before enabling this.
image 'legatus-build:26.04'
reuseNode true
// RTI Connext is not part of the image and has to be mounted read-only.
args '-u root:root -v /opt/rti_connext_dds-7.7.0:/opt/rti_connext_dds-7.7.0:ro'
}
}
options {
timestamps()
disableConcurrentBuilds()
}
environment {
PROJECT_DIR = "qt6-after/qt6-migrated-legatus"
BUILD_DIR = "qt6-after/qt6-migrated-legatus/build-ci"
CHANGE_TARGET = "${env.CHANGE_TARGET ?: 'origin/main'}"
QT_QPA_PLATFORM = "offscreen"
LANG = "C.UTF-8"
LC_ALL = "C.UTF-8"
// Targets known to build and test green today. A full `cmake --build` still
// fails outside TetraIF: Z/src/nglwidgets has an unfinished Poppler port, and
// several targets compile the RTI headers without -DRTI_UNIX. Widen this list
// as those modules get migrated.
BUILD_TARGETS = "CoPrtCnv PrtCnvLib PrtCnv LogView_console CoPrtCnvTests PrtCnvTests LogViewTests"
TEST_REGEX = "CoPrtCnvRadioTelegramTest|PrtCnvMemberTest|PrtCnvStoredTelegramTest|LogViewFieldTest|LogViewTetraTelegramsParserTest"
}
stages {
stage('Checkout') {
steps {
checkout scm
sh 'git fetch --all --prune'
sh 'git submodule update --init --recursive || true'
}
}
stage('Tool Versions') {
steps {
sh '''
python3 --version
cmake --version
ninja --version
g++ --version
'''
}
}
stage('Qt Diagnostics') {
steps {
sh '''
echo "QT_QPA_PLATFORM=$QT_QPA_PLATFORM"
echo "LANG=$LANG"
echo "LC_ALL=$LC_ALL"
dpkg -l | grep -E "qt6-base-dev|qt6-tools|qt6-websockets-dev" || true
ls /opt/rti_connext_dds-7.7.0 >/dev/null && echo "RTI Connext mounted" || echo "RTI Connext MISSING"
'''
}
}
stage('Policy Checks') {
steps {
sh 'python3 ci/check_pr_policies.py'
}
}
stage('Configure') {
steps {
// The project pins CMAKE_CXX_STANDARD to 17; do not override it here.
sh '''
cmake -S ${PROJECT_DIR} -B ${BUILD_DIR} \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_RTI=ON \
-DBUILD_ARCGIS=OFF
'''
}
}
stage('Build') {
steps {
sh 'cmake --build ${BUILD_DIR} --parallel --target ${BUILD_TARGETS}'
}
}
stage('Test') {
steps {
sh 'ctest --test-dir ${BUILD_DIR} -R "${TEST_REGEX}" --output-on-failure'
}
}
}
post {
always {
script {
if (getContext(hudson.FilePath)) {
cleanWs deleteDirs: true, disableDeferredWipeout: true
}
}
}
}
}