From: David ‘Bombe’ Roden Date: Mon, 30 Sep 2024 16:59:07 +0000 (+0200) Subject: 💚 Build once on Java 8 and once on Java 17 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a9907b2faa19128eb771048948c04a9a1a37c17a;p=Sone.git 💚 Build once on Java 8 and once on Java 17 --- 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' + } } } }