Skip to content

Commit c043b2c

Browse files
committed
feat: sonar in maven
1 parent 1a11e23 commit c043b2c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/maven-bump-push-dockerhub.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
uses: actions/checkout@v3
2525
with:
2626
token: ${{ secrets.BUMP_PAT }}
27+
fetch-depth: 0 # For Sonar blame information
2728

2829
- name: Set up Java
2930
uses: actions/setup-java@v3
@@ -41,8 +42,17 @@ jobs:
4142
with:
4243
commit-message: "[skip ci] Bump version to"
4344

44-
- name: Package with Maven
45-
run: mvn package -B -P prod "-Dmaven.test.skip" "-Dstyle.color=always"
45+
- name: Verify with Maven
46+
env:
47+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
48+
run: |
49+
REPO_NAME=$(echo "${{ github.repository }}" | cut -d '/' -f 2)
50+
51+
mvn verify -B -P prod,coverage "-Dstyle.color=always" \
52+
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
53+
-Dsonar.host.url="https://sonarcloud.io" \
54+
-Dsonar.organization=soat-tech-challenge \
55+
-Dsonar.projectKey=soat-tech-challenge_$REPO_NAME
4656
4757
- name: Login to Docker Hub
4858
uses: docker/login-action@v3

0 commit comments

Comments
 (0)