diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2918079..ad6fee1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,7 +9,27 @@ jobs: - name: Set up Java uses: actions/setup-java@v4 with: - java-version: '11' + java-version: | + 11 + 17 distribution: 'temurin' - - name: Run tests - run: mvn test + - name: Cache SonarQube packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: >- + mvn -B verify sonar:sonar + -Dsonar.java.jdkHome=$JAVA_HOME_11_X64 + -Dsonar.projectKey=pgmarc_space-java-client + -Pcoverage diff --git a/pom.xml b/pom.xml index f0809ae..0095308 100644 --- a/pom.xml +++ b/pom.xml @@ -154,6 +154,46 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.14.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.3 + + + org.apache.maven.plugins + maven-surefire-report-plugin + 3.5.3 + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.6.1 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.11.2 + + + org.apache.maven.plugins + maven-source-plugin + 3.3.1 + + + org.apache.maven.plugins + maven-jar-plugin + 3.4.2 + + + org.sonarsource.scanner.maven + sonar-maven-plugin + 5.1.0.4751 + org.jacoco jacoco-maven-plugin @@ -162,20 +202,9 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.14.0 - - - org.apache.maven.plugins - maven-surefire-plugin - 3.5.3 - org.apache.maven.plugins maven-source-plugin - 3.3.1 attach-sources @@ -188,7 +217,6 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.11.2 attach-javadocs @@ -201,7 +229,6 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.6.1 enforce-versions @@ -221,7 +248,7 @@ - +