diff --git a/.github/workflows/pull-request_backend.yml b/.github/workflows/pull-request_backend.yml index 0915532be0..789da9d7e2 100644 --- a/.github/workflows/pull-request_backend.yml +++ b/.github/workflows/pull-request_backend.yml @@ -56,8 +56,7 @@ jobs: run: | echo ${{steps.pom-version.outputs.pom_changed}} - - Test-and-Sonar: + Test: permissions: checks: write pull-requests: write @@ -87,6 +86,21 @@ jobs: files: "**/surefire-reports/TEST-*.xml" check_name: "Unit Test Results" + Sonar: + needs: Test + permissions: + checks: write + pull-requests: write + runs-on: ubuntu-latest + if: success() + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '${{ env.JAVA_VERSION }}' + distribution: 'temurin' + cache: 'maven' + - name: Clean working directories run: | rm -rf .scannerwork @@ -99,6 +113,9 @@ jobs: key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar + - name: Compile + run: mvn -pl tx-models,tx-backend,tx-coverage -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B compile + - name: Verify Sonar Scan env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any @@ -108,7 +125,7 @@ jobs: run: mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn --batch-mode sonar:sonar -Dsonar.coverage.jacoco.xmlReportPaths=${{ github.workspace }}/tx-coverage/target/site/jacoco-aggregate/jacoco.xml -Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY_BACKEND }} -Dsonar.organization=${{ vars.SONAR_ORGANIZATION }} Publish-docker-image: - # needs: [ "Test-and-Sonar" ] + # needs: [ "Test-and-Sonar" ] runs-on: ubuntu-latest defaults: run: