diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 4d6ab4b..c31755f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -22,59 +22,37 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 17 - uses: actions/setup-java@v3 + - name: Set up JDK 21 + uses: actions/setup-java@v5 with: - java-version: '17' - distribution: 'temurin' + java-version: '21' + distribution: 'zulu' cache: maven - name: Cache SonarQube packages - uses: actions/cache@v3 + uses: actions/cache@v5 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Cache Maven packages - uses: actions/cache@v3 + uses: actions/cache@v5 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - name: Build with Maven and analyze with SonarQube env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: | mvn -B test -Pcoverage verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ - -Dsonar.javaOpts="-Xmx8192m " \ - -Dsonar.scanner.debug="true" \ - -Dsonar.sources="." \ - -Dsonar.exclusions="src/test/java/**/*" \ - -Dsonar.tests="src/test/java" \ - -X - - - name: SonarQube Pull Request Analysis - if: ${{ github.event_name == 'pull_request' }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - run: | - mvn -B test -Pcoverage verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ - -Dsonar.pullrequest.key="${{ github.event.pull_request.number }}" \ - -Dsonar.pullrequest.base="${{ github.event.pull_request.base.ref }}" \ - -Dsonar.pullrequest.branch="${{ github.head_ref }}" \ - -Dsonar.javaOpts="-Xmx8192m " \ - -Dsonar.scanner.debug="true" \ - -Dsonar.sources="." \ - -Dsonar.exclusions="src/test/java/**/*" \ - -Dsonar.tests="src/test/java" \ - -X + -Dsonar.maven.scanAll=True # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive #- name: Update dependency graph # uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 + +