Skip to content

Commit 286ae92

Browse files
authored
Merge pull request #793 from mivek/ci/sonar-analysis
ci: activate CI-based analysis instead of automatic analysis
2 parents 641a504 + 597586c commit 286ae92

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

.github/workflows/maven-verify.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
name: Maven verify
22

33
on:
4+
push:
5+
branches:
6+
- main
47
pull_request:
8+
types: [opened, synchronize, reopened]
59

610
jobs:
711
verify:
812
runs-on: ubuntu-latest
9-
permissions:
10-
pull-requests: write
1113
steps:
1214
- uses: actions/checkout@v6
1315
with:
@@ -17,23 +19,23 @@ jobs:
1719
with:
1820
java-version: '17'
1921
distribution: 'adopt'
22+
- name: Cache SonarQube packages
23+
uses: actions/cache@v5
24+
with:
25+
path: ~/.sonar/cache
26+
key: ${{ runner.os }}-sonar
27+
restore-keys: ${{ runner.os }}-sonar
2028
- name: Cache maven packages
2129
uses: actions/cache@v5
2230
with:
2331
path: ~/.m2
2432
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
2533
restore-keys: ${{ runner.os }}-m2
2634
- name: Run the maven verify
27-
run: mvn --batch-mode --update-snapshots clean verify
35+
env:
36+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
37+
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=mivek_MetarParser
2838

29-
- name: Save the PR number in a file
30-
run: echo ${{ github.event.number }} > PR_NUMBER.txt
31-
32-
- name: Upload the PR number as an artifact
33-
uses: actions/upload-artifact@v5.0.0
34-
with:
35-
name: PR_NUMBER
36-
path: PR_NUMBER.txt
3739
generate-docs:
3840
runs-on: ubuntu-latest
3941
needs: verify

0 commit comments

Comments
 (0)