Skip to content

Commit

Permalink
Merge pull request #1375 from eclipse-tractusx/feature/seperate-sonar…
Browse files Browse the repository at this point in the history
…-action-from-tests

feature: split sonar action from pr action
  • Loading branch information
ds-mwesener authored Oct 17, 2024
2 parents 25a4bdd + e67792d commit dc092ce
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/pull-request_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ jobs:
run: |
echo ${{steps.pom-version.outputs.pom_changed}}
Test-and-Sonar:
Test:
permissions:
checks: write
pull-requests: write
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit dc092ce

Please sign in to comment.