This is an automated email from the ASF dual-hosted git repository.

benw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git

commit 911552addbfdcaf42aa20e7589df99fd8f822194
Author: Ben Weidig <[email protected]>
AuthorDate: Sat Apr 4 13:19:02 2026 +0200

    TAP5-2819: Jenkinsfile use matrix for min/max JDK, more sensible timeouts
---
 Jenkinsfile                      | 142 ++++++++++++++++++++++-----------------
 Jenkinsfile.integration-variants |   4 +-
 2 files changed, 82 insertions(+), 64 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index a9ed885ba..6962788dd 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,83 +1,101 @@
 pipeline {
-    agent {
-        node {
-            label 'ubuntu'
-        }
-    }
+    agent none
 
     environment {
-        GRADLE_OPTS  = '-Dci=true -Dfile.encoding=UTF-8 
-Dselenium.wait.timeout=30'
-    }
-
-    tools {
-        jdk 'jdk_11_latest'
+        GRADLE_OPTS = '-Dci=true -Dfile.encoding=UTF-8 
-Dselenium.wait.timeout=30'
     }
 
     options {
-        timeout(time: 3, unit: 'HOURS')
+        timeout(time: 90, unit: 'MINUTES')
         skipStagesAfterUnstable()
     }
 
     stages {
+        stage('Matrix') {
+            matrix {
+                axes {
+                    axis {
+                        name   'JDK_VERSION'
+                        values 'jdk_11_latest', 'jdk_21_latest'
+                    }
+                }
 
-        // -- 01: Clean + Assemble 
---------------------------------------------
+                agent { node { label 'ubuntu' } }
 
-        stage('Assemble') {
-            steps {
-                sh './gradlew clean assemble'
-            }
-        }
+                tools {
+                    jdk "${JDK_VERSION}"
+                }
 
-        // -- 02: Test: Check - Unit + integration tests (jQuery + RequireJS) 
--
+                stages {
 
-        stage('Test: Check') {
-            steps {
-                sh './gradlew check --continue'
-            }
-            post {
-                always {
-                    junit(
-                        testResults: '**/build/test-results/test/**/*.xml',
-                        allowEmptyResults: true
-                    )
-                    archiveArtifacts(
-                        artifacts: '**/build/reports/tests/**/*, 
**/build/test-results/**/*',
-                        allowEmptyArchive: true
-                    )
-                }
-            }
-        }
+                    // -- 01: Clean + Assemble 
---------------------------------------------
 
-        // -- 03: Coverage (JaCoCo) 
--------------------------------------------
-
-       stage('Coverage') {
-           steps {
-               sh './gradlew combinedJacocoReport'
-           }
-           post {
-               always {
-                    archiveArtifacts(
-                        artifacts: '**/build/reports/jacoco/**/*',
-                        allowEmptyArchive: true
-                    )
-               }
-           }
-        }
+                    stage('Assemble') {
+                        steps {
+                            sh './gradlew clean assemble'
+                        }
+                    }
+
+                    // -- 02: Test + Coverage 
----------------------------------------------
+
+                    stage('Test: Check') {
+                        steps {
+                            // This will run unit tests and the default 
integration variant (jQuery + RequireJS).
+                            // We include the coverage report in this step, as 
modifying the test results with
+                            // sed would trigger a test rerun if it would be 
its own stage.
+                            sh './gradlew check combinedJacocoReport 
--continue'
+                        }
+                        post {
+                            always {
+                                // Prefix the JUnit classnames so the Test UI 
shows which JDK ran which test
+                                sh """
+                                    find . -path 
'*/build/test-results/test/*.xml' -exec \
+                                        sed -i 
's/classname="/classname="${JDK_VERSION}./g' {} +
+                                """
+
+                                junit(
+                                    testResults: 
'**/build/test-results/test/**/*.xml',
+                                    allowEmptyResults: true
+                                )
 
-        // -- 04: Aggregate Javadoc 
--------------------------------------------
+                                // Copy reports into a JDK-named folder to 
avoid overwriting between matrix cells
+                                sh """
+                                    find . \\( -path '*/build/reports' -o 
-path '*/build/test-results' \\) -type d | while IFS= read -r src; do
+                                        
dest="matrix-artifacts/${JDK_VERSION}/\${src#./}"
+                                        mkdir -p -- "\$dest"
+                                        cp -r -- "\$src/." "\$dest/"
+                                    done
+                                """
 
-        stage('Aggregate Javadoc') {
-            steps {
-                sh './gradlew aggregateJavadoc'
+                                archiveArtifacts(
+                                    artifacts: 
"matrix-artifacts/${JDK_VERSION}/**/*",
+                                    allowEmptyArchive: true
+                                )
+                            }
+                        }
+                    }
+                }
             }
-            post {
-                always {
-                    publishHTML(target: [
-                        reportDir:   'build/documentation/javadocs',
-                        reportFiles: 'index.html',
-                        reportName:  'Aggregate Javadoc',
-                        keepAll:     true
-                    ])
+
+            // -- 03: JavaDoc Generation 
-------------------------------------------
+
+            stage('Aggregate Javadoc') {
+                agent { node { label 'ubuntu' } }
+                tools {
+                    jdk 'jdk_21_latest'
+                }
+                steps {
+                    sh './gradlew aggregateJavadoc'
+                }
+                post {
+                    always {
+                        publishHTML(target: [
+                            reportDir:   'build/documentation/javadocs',
+                            reportFiles: 'index.html',
+                            reportName:  'Aggregate Javadoc',
+                            keepAll:     true
+                        ])
+                    }
                 }
             }
         }
diff --git a/Jenkinsfile.integration-variants b/Jenkinsfile.integration-variants
index b666e6b61..936506a87 100644
--- a/Jenkinsfile.integration-variants
+++ b/Jenkinsfile.integration-variants
@@ -5,7 +5,7 @@ pipeline {
 
     environment {
         // Disable the daemon to prevent parallal issues
-        GRADLE_OPTS  = '-Dci=true -Dfile.encoding=UTF-8 
-Dorg.gradle.daemon=false'
+        GRADLE_OPTS = '-Dci=true -Dfile.encoding=UTF-8 
-Dorg.gradle.daemon=false'
     }
 
     tools {
@@ -13,7 +13,7 @@ pipeline {
     }
 
     options {
-        timeout(time: 3, unit: 'HOURS')
+        timeout(time: 1, unit: 'HOURS')
         skipStagesAfterUnstable()
     }
 

Reply via email to