Skip to content

Commit 3a3215b

Browse files
authored
Merge pull request #214 from TransbankDevelopers/chore/add-coverage-report
chore: add coverage report
2 parents fa164c8 + 037d0ac commit 3a3215b

4 files changed

Lines changed: 81 additions & 75 deletions

File tree

.github/workflows/build.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Java CI + SonarCloud
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- develop
9+
pull_request:
10+
types: [synchronize, opened, reopened]
11+
12+
jobs:
13+
sonar-cloud:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up JDK 8
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: '8'
25+
distribution: 'temurin'
26+
27+
- name: Cache SonarCloud packages
28+
uses: actions/cache@v3
29+
with:
30+
path: ~/.sonar/cache
31+
key: ${{ runner.os }}-sonar
32+
restore-keys: ${{ runner.os }}-sonar
33+
34+
- name: Build with Maven
35+
run: mvn clean install -P no-gpg --no-transfer-progress
36+
37+
- name: Run SonarCloud Analysis
38+
uses: SonarSource/sonarqube-scan-action@master
39+
with:
40+
projectBaseDir: .
41+
env:
42+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

pom.xml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -221,52 +221,55 @@
221221
</execution>
222222
</executions>
223223
</plugin>
224-
224+
225225
<plugin>
226226
<groupId>org.jacoco</groupId>
227227
<artifactId>jacoco-maven-plugin</artifactId>
228-
<version>0.8.2</version>
228+
<version>0.8.11</version>
229229
<executions>
230230
<execution>
231+
<id>prepare-agent</id>
231232
<goals>
232233
<goal>prepare-agent</goal>
233234
</goals>
234235
</execution>
235236
<execution>
236237
<id>jacoco-report</id>
237-
<phase>test</phase>
238+
<phase>verify</phase>
238239
<goals>
239240
<goal>report</goal>
240241
</goals>
241242
</execution>
242-
<!-- Add this checking -->
243-
<execution>
244-
<id>jacoco-check</id>
245-
<goals>
246-
<goal>check</goal>
247-
</goals>
248-
<configuration>
249-
<rules>
250-
<rule>
251-
<element>PACKAGE</element>
252-
<limits>
253-
<limit>
254-
<counter>LINE</counter>
255-
<value>COVEREDRATIO</value>
256-
<minimum>0.0</minimum>
257-
</limit>
258-
</limits>
259-
</rule>
260-
</rules>
261-
</configuration>
262-
</execution>
263-
264243
</executions>
265244
</plugin>
245+
266246
</plugins>
267247
</build>
268248

269249
<profiles>
250+
<profile>
251+
<id>no-gpg</id>
252+
<activation>
253+
<property>
254+
<name>skipGpg</name>
255+
<value>true</value>
256+
</property>
257+
</activation>
258+
<build>
259+
<plugins>
260+
<plugin>
261+
<groupId>org.apache.maven.plugins</groupId>
262+
<artifactId>maven-gpg-plugin</artifactId>
263+
<executions>
264+
<execution>
265+
<id>sign-artifacts</id>
266+
<phase>none</phase>
267+
</execution>
268+
</executions>
269+
</plugin>
270+
</plugins>
271+
</build>
272+
</profile>
270273
<profile>
271274
<id>release</id>
272275
<build>

sonar-project.properties

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
sonar.organization=transbankdevelopers
2+
sonar.projectKey=TransbankDevelopers_transbank-sdk-java
3+
sonar.language=java
4+
sonar.projectVersion=1.0.0
5+
sonar.sourceEncoding=UTF-8
6+
sonar.sources=src/main/java
7+
sonar.tests=src/test/java
8+
sonar.java.binaries=target/classes
9+
sonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml
10+
sonar.exclusions=**/model/**,**/requests/**,**/responses/**

0 commit comments

Comments
 (0)