Skip to content

Commit

Permalink
CDR-1382 Add sonar support
Browse files Browse the repository at this point in the history
  • Loading branch information
vidi42 authored Apr 15, 2024
1 parent 2bbabea commit 889eb4a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 48 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: build

on:
push:
branches: [ develop, release/* ]
pull_request:
branches: [ develop ]
workflow_dispatch:

jobs:
Expand All @@ -25,6 +27,15 @@ jobs:
- name: Spotless
run: mvn -B spotless:apply

- name: Build with Maven
run: mvn -B verify
- name: Run Checks
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn clean verify test jacoco:report-aggregate package sonar:sonar \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.organization=ehrbase \
-Dsonar.projectKey=ehrbase_openEHR_SDK \
-Dsonar.exclusions=test/** \
-Dsonar.coverage.exclusions=test/**,test-data/**/*,opt-14/**/*,response-dto/**/* \
-Dsonar.coverage.jacoco.xmlReportPaths=${{ github.workspace }}/test-coverage/target/site/jacoco-overall-coverage/jacoco.xml
6 changes: 6 additions & 0 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<jacoco.version>0.8.11</jacoco.version>
<threeten-extra.version>1.7.2</threeten-extra.version>
<jaxb-runtime.version>2.3.9</jaxb-runtime.version>
<sonar.scanner.version>3.11.0.3922</sonar.scanner.version>
</properties>

<distributionManagement>
Expand Down Expand Up @@ -454,6 +455,11 @@
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar.scanner.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
46 changes: 0 additions & 46 deletions sonar-project.properties

This file was deleted.

0 comments on commit 889eb4a

Please sign in to comment.