Skip to content

Commit c2ecf63

Browse files
committed
removed sonar code analysis from github actions
1 parent 30f1bfa commit c2ecf63

File tree

1 file changed

+2
-59
lines changed

1 file changed

+2
-59
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -28,66 +28,9 @@ jobs:
2828
distribution: 'adopt'
2929
cache: maven
3030

31-
- name: Build the Project
32-
run: mvn clean install -DskipTests
31+
- name: Build the Project and run tests
32+
run: mvn clean install
3333

34-
- name: Test Execution
35-
run: mvn org.jacoco:jacoco-maven-plugin:prepare-agent install -Pcoverage-per-test
36-
37-
- name: Upload target folder
38-
uses: actions/upload-artifact@v4
39-
with:
40-
name: target
41-
path: |
42-
${{ github.workspace }}/target
43-
${{ github.workspace }}/reports
44-
code_analysis:
45-
name: Code Analysis
46-
needs:
47-
- build_and_test
48-
49-
runs-on: ubuntu-latest
50-
51-
steps:
52-
- name: checkout Git repository
53-
uses: actions/checkout@v4
54-
with:
55-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
56-
57-
- name: Install Java and Maven
58-
uses: actions/setup-java@v4
59-
with:
60-
java-version: '21'
61-
distribution: 'adopt'
62-
cache: maven
63-
64-
- name: Cache SonarCloud packages
65-
uses: actions/cache@v4
66-
with:
67-
path: ~/.sonar/cache
68-
key: ${{ runner.os }}-sonar
69-
restore-keys: ${{ runner.os }}-sonar
70-
71-
- name: Cache Maven packages
72-
uses: actions/cache@v4
73-
with:
74-
path: ~/.m2
75-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
76-
restore-keys: ${{ runner.os }}-m2
77-
78-
- name: Download target folder
79-
uses: actions/download-artifact@v4
80-
with:
81-
name: target
82-
83-
- name: Sonar Code Analysis
84-
env:
85-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
86-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
87-
SONAR_KEY: ${{ secrets.SONAR_KEY }}
88-
run: |
89-
mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
90-
-Dsonar.projectKey=$SONAR_KEY
9134
- name: Test Report
9235
uses: dorny/test-reporter@v2
9336
if: success() || failure()

0 commit comments

Comments
 (0)