From 8da2a506d1ee54f3ca6ea3f497984f9827716ea9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 2 Oct 2024 09:47:44 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=8F=97=EF=B8=8F=20Add=20Jenkinsfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ build.gradle | 8 ++++++-- 2 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..cbb182e --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,64 @@ +pipeline { + agent any + + options { + timestamps() + } + + stages { + stage('Build (Java 8)') { + tools { + jdk 'OpenJDK 8' + } + steps { + sh './gradlew clean classes testClasses' + } + } + stage('Test (Java 8)') { + tools { + jdk 'OpenJDK 8' + } + steps { + sh './gradlew test jacocoTestReport' + } + post { + always { + junit 'build/test-results/*/*.xml' + jacoco classPattern: 'build/classes/*/main', sourcePattern: '**/src/main/' + recordCoverage(tools: [[parser: 'JACOCO', pattern: '**/jacocoTestReport.xml']]) + } + } + } + stage('Binary (Java 8)') { + tools { + jdk 'OpenJDK 8' + } + steps { + sh './gradlew fatJar' + archiveArtifacts artifacts: 'build/libs/jSite*-jar-with-dependencies.jar', fingerprint: true + } + } + stage('Compatibility (Java 17)') { + tools { + jdk 'OpenJDK 17' + } + steps { + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh './gradlew clean test' + } + } + } + stage('Compatibility (Java 21)') { + tools { + jdk 'OpenJDK 21' + } + steps { + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh './gradlew clean test' + } + } + } + } +} + +// vi: ts=4 sw=4 et si diff --git a/build.gradle b/build.gradle index bb21b70..c530c78 100644 --- a/build.gradle +++ b/build.gradle @@ -42,5 +42,9 @@ jacoco { toolVersion = '0.8.10' } -jacocoTestReport.dependsOn test - +jacocoTestReport { + dependsOn test + reports { + xml.enabled = true + } +} -- 2.7.4