Skip to content

Commit

Permalink
SonarCloud in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Apr 25, 2021
1 parent d2343b1 commit b5d091f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
path: |
~/.m2
~/.sonar/cache
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml', '**/*.yml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Unit and Integration Tests
Expand All @@ -31,4 +33,12 @@ jobs:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
- name: End-to-end tests
run: xvfb-run mvn verify -Pe2e-tests
- name: SonarCloud
run: >
mvn sonar:sonar
-Dsonar.organization=lorenzobettini-github
-Dsonar.host.url=https://sonarcloud.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.6.0.1398</version>
<version>3.8.0.2131</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down

0 comments on commit b5d091f

Please sign in to comment.