From 2db7c0439e559b4c00ea860d117ec04ea5c738bf Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Thu, 17 Aug 2023 10:56:20 +0200 Subject: [PATCH] Uses Java 17 to perform Code Quality check --- .github/workflows/maven.yml | 3 +-- Jenkinsfile | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 3d1d1cf07..5efaba9b9 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -49,10 +49,9 @@ jobs: distribution: adopt java-version: ${{ matrix.java }} - name: Build with Maven on Java ${{ matrix.java }} - if: matrix.java != '11' run: mvn -B -V -DskipAssembly test --no-transfer-progress - name: Code coverage on Java ${{ matrix.java }} - if: matrix.java == '11' + if: matrix.java == '17' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} diff --git a/Jenkinsfile b/Jenkinsfile index 1a5c56c20..bced1a82c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,7 +44,7 @@ pipeline { } stage('Test') { steps { - sh './mvnw -B test' + sh './mvnw -B verify -Pcoverage -DskipAssembly' } post { always { @@ -53,6 +53,16 @@ pipeline { } } } + stage('Code Quality') { + when { + branch 'master' + } + steps { + withCredentials([string(credentialsId: 'asf-struts-sonarcloud', variable: 'SONARCLOUD_TOKEN')]) { + sh './mvnw -B -Pcoverage -DskipAssembly -Dsonar.login=${SONARCLOUD_TOKEN} verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar' + } + } + } } post { always { @@ -79,7 +89,7 @@ pipeline { } stage('Test') { steps { - sh './mvnw -B verify -Pcoverage -DskipAssembly' + sh './mvnw -B test' } post { always { @@ -88,16 +98,6 @@ pipeline { } } } - stage('Code Quality') { - when { - branch 'master' - } - steps { - withCredentials([string(credentialsId: 'asf-struts-sonarcloud', variable: 'SONARCLOUD_TOKEN')]) { - sh './mvnw -B -Pcoverage -DskipAssembly -Dsonar.login=${SONARCLOUD_TOKEN} verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar' - } - } - } } post { always {