Skip to content

Commit ab065f3

Browse files
committed
feat: use jacoco for coverage testing
1 parent 5149081 commit ab065f3

File tree

5 files changed

+103
-25
lines changed

5 files changed

+103
-25
lines changed

.codecov.yml

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

.github/workflows/maven.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,41 @@ jobs:
4444
name: build_${{ matrix.runner }}
4545
retention-days: 1
4646
path: coatjava.tar.gz
47+
- name: publish jacoco report
48+
run: validation/jacoco-aggregate.sh
49+
- uses: actions/upload-artifact@v3
50+
with:
51+
name: jacoco
52+
retention-days: 1
53+
path: publish/
54+
55+
collect_pages:
56+
runs-on: ubuntu-latest
57+
needs:
58+
- build
59+
steps:
60+
- uses: actions/download-artifact@v3
61+
with:
62+
name: jacoco
63+
path: publish/
64+
- uses: actions/upload-pages-artifact@v2
65+
with:
66+
path: publish/
67+
retention-days: 7
68+
69+
deploy_pages:
70+
needs: collect_pages
71+
permissions:
72+
pages: write
73+
id-token: write
74+
environment:
75+
name: github-pages
76+
url: ${{ steps.deployment.outputs.page_url }}
77+
runs-on: ubuntu-latest
78+
steps:
79+
- name: deployment
80+
id: deployment
81+
uses: actions/deploy-pages@v2
4782

4883
test_coatjava:
4984
needs: [ build ]

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# COATJAVA
22
[![Build Status](https://github.com/jeffersonlab/coatjava/workflows/Coatjava-CI/badge.svg)](https://github.com/jeffersonlab/coatjava/actions)
33
[![Validation Status](https://github.com/JeffersonLab/coatjava/actions/workflows/validation.yml/badge.svg)](https://github.com/JeffersonLab/coatjava/actions/workflows/validation.yml)
4-
[![codecov](https://codecov.io/gh/JeffersonLab/coatjava/branch/development/graph/badge.svg?precision=2)](https://codecov.io/gh/JeffersonLab/coatjava/branch/development)
54

65
The original repository for COATJAVA was named "clas12-offline-software" and is [now archived and read-only](https://github.com/JeffersonLab/clas12-offline-software). On May 17, 2023, this new repository was created by running BFG Repo Cleaner to get rid of old, large data files and things that should never have been in the repository, giving 10x reduction in repository size, clone time, etc, and renamed `coatjava`. The most critical, GitHub-specific aspects have been transferred to this new repository:
76

parent/pom.xml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747
<version>4.0.5</version>
4848
</dependency>
4949

50+
<!-- https://mvnrepository.com/artifact/org.jacoco/jacoco-maven-plugin -->
51+
<dependency>
52+
<groupId>org.jacoco</groupId>
53+
<artifactId>jacoco-maven-plugin</artifactId>
54+
<version>0.8.10</version>
55+
</dependency>
56+
5057
</dependencies>
5158

5259
<build>
@@ -59,18 +66,6 @@
5966
</extensions>
6067

6168
<plugins>
62-
<plugin> <!-- for codecov -->
63-
<groupId>org.codehaus.mojo</groupId>
64-
<artifactId>cobertura-maven-plugin</artifactId>
65-
<version>2.7</version>
66-
<configuration>
67-
<formats>
68-
<format>html</format>
69-
<format>xml</format>
70-
</formats>
71-
<check />
72-
</configuration>
73-
</plugin>
7469

7570
<plugin>
7671
<groupId>com.github.spotbugs</groupId>
@@ -134,6 +129,26 @@
134129
</configuration>
135130
</plugin>
136131

132+
<plugin>
133+
<groupId>org.jacoco</groupId>
134+
<artifactId>jacoco-maven-plugin</artifactId>
135+
<version>0.8.10</version>
136+
<executions>
137+
<execution>
138+
<goals>
139+
<goal>prepare-agent</goal>
140+
</goals>
141+
</execution>
142+
<execution>
143+
<id>report</id>
144+
<phase>prepare-package</phase>
145+
<goals>
146+
<goal>report</goal>
147+
</goals>
148+
</execution>
149+
</executions>
150+
</plugin>
151+
137152
</plugins>
138153

139154
</build>

validation/jacoco-aggregate.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
# simple script to aggregate jacoco results, until we figure out a better way
3+
4+
mkdir -p publish
5+
rm -r publish
6+
mkdir -p publish
7+
for d in $(find -type d -name 'jacoco'); do
8+
target=publish/$(echo $d | sed 's;^\./;;')
9+
mkdir -p $target
10+
cp -r $d/* $target/
11+
done
12+
13+
pushd publish
14+
15+
cat << EOF > index.html
16+
<html>
17+
<head>
18+
<title>JaCoCo Coverage Summary</title>
19+
</head>
20+
<body>
21+
<h1>JaCoCo Coverage Summary</h1>
22+
<ul>
23+
EOF
24+
25+
for indexPage in $(find . -name "index.html" | grep 'jacoco/index'); do
26+
link=$(echo $indexPage | sed 's;^./;;')
27+
name=$(echo $link | sed 's;/target/site/.*;;')
28+
cat << EOF >> index.html
29+
<li><a href="$link">$name</a></li>
30+
EOF
31+
done
32+
33+
cat << EOF >> index.html
34+
</body>
35+
</html>
36+
EOF
37+
38+
echo "==============="
39+
cat index.html
40+
echo "==============="
41+
popd

0 commit comments

Comments
 (0)