Skip to content

Commit

Permalink
ARC-1298: Don't run SONAR in forks
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrichner-oviva committed Feb 15, 2024
1 parent 0b810ca commit 58aea78
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,23 @@ jobs:
java-version: 21
distribution: 'temurin'
cache: 'maven'
- name: Run unit tests
run: ./mvnw -B verify
- name: Cache SonarCloud packages
if: ${{ github.event.pull_request.head.repo.full_name == 'oviva-ag/ehealthid-relying-party' }}
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Run unit tests
- name: Check Coverage
if: ${{ github.event.pull_request.head.repo.full_name != 'oviva-ag/ehealthid-relying-party' }}
run:
- name: Run Sonar
if: ${{ github.event.pull_request.head.repo.full_name == 'oviva-ag/ehealthid-relying-party' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./mvnw -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
run: ./mvnw -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar


27 changes: 27 additions & 0 deletions ehealthid-rp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,33 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.80</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
32 changes: 32 additions & 0 deletions ehealthid/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,36 @@

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.80</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>

0 comments on commit 58aea78

Please sign in to comment.