Skip to content

Commit 08e708a

Browse files
committed
add jacoco
1 parent f8fbab8 commit 08e708a

File tree

5 files changed

+91
-3
lines changed

5 files changed

+91
-3
lines changed

.github/workflows/coverage.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [ master, upgrade ]
6+
paths:
7+
- 'accessors-smart/**'
8+
- 'json-smart/**'
9+
- '.github/workflows/coverage.yml'
10+
pull_request:
11+
branches: [ master ]
12+
paths:
13+
- 'accessors-smart/**'
14+
- 'json-smart/**'
15+
- '.github/workflows/coverage.yml'
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
coverage:
22+
name: Code Coverage
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Set up JDK 11
30+
uses: actions/setup-java@v4
31+
with:
32+
java-version: 11
33+
distribution: 'temurin'
34+
cache: 'maven'
35+
36+
- name: Build and test accessors-smart with coverage
37+
run: cd accessors-smart && ./mvnw -q clean test
38+
39+
- name: Build and test json-smart with coverage
40+
run: cd json-smart && ./mvnw -q clean test
41+
42+
- name: Upload coverage to Coveralls
43+
uses: coverallsapp/github-action@v2
44+
with:
45+
github-token: ${{ secrets.GITHUB_TOKEN }}
46+
path-to-lcov: |
47+
accessors-smart/target/site/jacoco/jacoco.xml
48+
json-smart/target/site/jacoco/jacoco.xml
49+
format: jacoco

.github/workflows/security.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ jobs:
4949
languages: ${{ matrix.language }}
5050

5151
- name: Build project accessors-smart
52-
run: cd accessors-smart && ./mvnw -q clean install test
52+
run: cd accessors-smart && ./mvnw -q clean install
5353

5454
- name: Build project json-smart
55-
run: cd json-smart && ./mvnw -q clean install test
55+
run: cd json-smart && ./mvnw -q clean install
5656

5757
- name: Build project json-smart-action
58-
run: cd json-smart-action && ./mvnw -q clean install test
58+
run: cd json-smart-action && ./mvnw -q clean install
5959

6060
- name: Perform CodeQL Analysis
6161
uses: github/codeql-action/analyze@v3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
**/bin
1010
**/target
1111
**/.vscode/
12+
.env

accessors-smart/pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,25 @@ limitations under the License.
259259
</java>
260260
</configuration>
261261
</plugin>
262+
<plugin>
263+
<groupId>org.jacoco</groupId>
264+
<artifactId>jacoco-maven-plugin</artifactId>
265+
<version>0.8.13</version>
266+
<executions>
267+
<execution>
268+
<goals>
269+
<goal>prepare-agent</goal>
270+
</goals>
271+
</execution>
272+
<execution>
273+
<id>report</id>
274+
<phase>test</phase>
275+
<goals>
276+
<goal>report</goal>
277+
</goals>
278+
</execution>
279+
</executions>
280+
</plugin>
262281
</plugins>
263282
</build>
264283
<dependencies>

json-smart/pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,25 @@ limitations under the License.
270270
</java>
271271
</configuration>
272272
</plugin>
273+
<plugin>
274+
<groupId>org.jacoco</groupId>
275+
<artifactId>jacoco-maven-plugin</artifactId>
276+
<version>0.8.13</version>
277+
<executions>
278+
<execution>
279+
<goals>
280+
<goal>prepare-agent</goal>
281+
</goals>
282+
</execution>
283+
<execution>
284+
<id>report</id>
285+
<phase>test</phase>
286+
<goals>
287+
<goal>report</goal>
288+
</goals>
289+
</execution>
290+
</executions>
291+
</plugin>
273292
</plugins>
274293
</build>
275294
<dependencies>

0 commit comments

Comments
 (0)