From a9907b2faa19128eb771048948c04a9a1a37c17a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 30 Sep 2024 18:59:07 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=92=9A=20Build=20once=20on=20Java=208=20an?= =?utf8?q?d=20once=20on=20Java=2017?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e058c32..8311a71 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { } stages { - stage('Build') { + stage('Build (Java 8)') { tools { jdk 'OpenJDK 8' } @@ -14,7 +14,7 @@ pipeline { sh './gradlew clean classes testClasses' } } - stage('Test') { + stage('Test (Java 8)') { tools { jdk 'OpenJDK 8' } @@ -24,10 +24,11 @@ pipeline { post { always { junit 'build/test-results/*/*.xml' + jacoco classPattern: 'build/classes/*/main', sourcePattern: '**/src/main/' } } } - stage('Binary') { + stage('Binary (Java 8)') { tools { jdk 'OpenJDK 8' } @@ -36,13 +37,24 @@ pipeline { archiveArtifacts artifacts: 'build/libs/sone*-jar-with-dependencies.jar', fingerprint: true } } - stage('Reports') { + stage('Build (Java 17)') { tools { - jdk 'OpenJDK 8' + jdk 'OpenJDK 17' + } + steps { + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh './gradlew clean classes testClasses' + } + } + } + stage('Test (Java 17)') { + tools { + jdk 'OpenJDK 17' } steps { - sh './gradlew jacocoTestReport' - jacoco classPattern: 'build/classes/*/main', sourcePattern: '**/src/main/' + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh './gradlew test' + } } } } -- 2.7.4