agent none
stages {
+ /*
+ Run the build and test suite on various distributions...
+ */
+ stage("Run Tests on Multiple Distributions") {
+ matrix {
+ axes {
+ axis {
+ name "DISTRO"
+ values \
+ "archlinux:base-devel", \
+ "debian:trixie", \
+ "debian:bookworm-backports", \
+ "fedora:latest", \
+ "fedora:rawhide", \
+ "ubuntu:24.10", \
+ "ubuntu:24.04"
+ }
+
+ axis {
+ name "COMPILER"
+ values "gcc", "clang"
+ }
+ }
+
+ agent {
+ docker {
+ image "${DISTRO}"
+
+ // Run as root inside the containers to install dependencies
+ args "--privileged -u root"
+
+ customWorkspace "${JOB_NAME}/${BUILD_ID}/${env.DISTRO.replace(":", "-")}/${env.COMPILER}"
+ }
+ }
+
+ stages {
+ stage("Install Dependencies") {
+ steps {
+ script {
+ // Arch Linux
+ if (env.DISTRO.contains("archlinux")) {
+ installBuildDepsArchLinux(env.DISTRO, env.COMPILER)
+
+ // Fedora, Alma Linux, etc.
+ } else if (env.DISTRO.contains("fedora") || env.DISTRO.contains("almalinux")) {
+ installBuildDepsRedHat(env.DISTRO, env.COMPILER)
+
+ // Debian & Ubuntu
+ } else if (env.DISTRO.contains("debian") || env.DISTRO.contains("ubuntu")) {
+ installBuildDepsDebian(env.DISTRO, env.COMPILER)
+ }
+ }
+ }
+ }
+
+ stage("Configure") {
+ steps {
+ // Run autogen
+ sh "./autogen.sh"
+
+ // Run ./configure...
+ sh "CC=${env.COMPILER} ./configure --prefix=/usr --enable-debug"
+ }
+
+ post {
+ failure {
+ archiveArtifacts artifacts: "config.log",
+ allowEmptyArchive: true
+
+ echo "config.log has been archived"
+ }
+ }
+ }
+
+ stage("Build") {
+ steps {
+ sh "make"
+ }
+ }
+
+ stage("Check") {
+ steps {
+ script {
+ try {
+ sh "make check"
+ } catch (Exception e) {
+ unstable("Failed on ${env.DISTRO} with ${env.COMPILER}...")
+ }
+ }
+ }
+
+ post {
+ always {
+ // Copy test logs into a special directory
+ sh """
+ mkdir -pv tests/${DISTRO}/${COMPILER}
+ find tests -name "*.log" | xargs --no-run-if-empty \
+ cp --verbose --parents --target-directory=tests/${DISTRO}/${COMPILER}/
+ """
+
+ // Archive the logs only if the stage fails
+ archiveArtifacts artifacts: "tests/${DISTRO}/${COMPILER}/**/*"
+
+ echo "The test logs have been archived"
+ }
+ }
+ }
+ }
+ }
+ }
+
stage("Coverage Tests") {
parallel {
/*
}
}
- /*
- Run the build and test suite on various distributions...
- */
- stage("Run Tests on Multiple Distributions") {
- matrix {
- axes {
- axis {
- name "DISTRO"
- values \
- "archlinux:base-devel", \
- "debian:trixie", \
- "debian:bookworm-backports", \
- "fedora:latest", \
- "fedora:rawhide", \
- "ubuntu:24.10", \
- "ubuntu:24.04"
- }
-
- axis {
- name "COMPILER"
- values "gcc", "clang"
- }
- }
-
- agent {
- docker {
- image "${DISTRO}"
-
- // Run as root inside the containers to install dependencies
- args "--privileged -u root"
-
- customWorkspace "${JOB_NAME}/${BUILD_ID}/${env.DISTRO.replace(":", "-")}/${env.COMPILER}"
- }
- }
-
- stages {
- stage("Install Dependencies") {
- steps {
- script {
- // Arch Linux
- if (env.DISTRO.contains("archlinux")) {
- installBuildDepsArchLinux(env.DISTRO, env.COMPILER)
-
- // Fedora, Alma Linux, etc.
- } else if (env.DISTRO.contains("fedora") || env.DISTRO.contains("almalinux")) {
- installBuildDepsRedHat(env.DISTRO, env.COMPILER)
-
- // Debian & Ubuntu
- } else if (env.DISTRO.contains("debian") || env.DISTRO.contains("ubuntu")) {
- installBuildDepsDebian(env.DISTRO, env.COMPILER)
- }
- }
- }
- }
-
- stage("Configure") {
- steps {
- // Run autogen
- sh "./autogen.sh"
-
- // Run ./configure...
- sh "CC=${env.COMPILER} ./configure --prefix=/usr --enable-debug"
- }
-
- post {
- failure {
- archiveArtifacts artifacts: "config.log",
- allowEmptyArchive: true
-
- echo "config.log has been archived"
- }
- }
- }
-
- stage("Build") {
- steps {
- sh "make"
- }
- }
-
- stage("Check") {
- steps {
- script {
- try {
- sh "make check"
- } catch (Exception e) {
- unstable("Failed on ${env.DISTRO} with ${env.COMPILER}...")
- }
- }
- }
-
- post {
- always {
- // Copy test logs into a special directory
- sh """
- mkdir -pv tests/${DISTRO}/${COMPILER}
- find tests -name "*.log" | xargs --no-run-if-empty \
- cp --verbose --parents --target-directory=tests/${DISTRO}/${COMPILER}/
- """
-
- // Archive the logs only if the stage fails
- archiveArtifacts artifacts: "tests/${DISTRO}/${COMPILER}/**/*"
-
- echo "The test logs have been archived"
- }
- }
- }
- }
- }
- }
-
stage("Debian Packages") {
stages {
stage("Build Debian Packages") {