Skip to content

Commit eb54954

Browse files
authored
Update code coverage with coveralls and build badge with github actions (#175)
* Update code coverage with coveralls and build badge with github actions * Update pom.xml with jacoco plugin
1 parent c9bdd5d commit eb54954

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed

.github/workflows/main.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,10 @@ jobs:
3232

3333
- name: Run test
3434
shell: bash
35-
run : mvn -V -B -U clean test
35+
run : mvn -V -B -U clean test jacoco:report
36+
37+
- name: Coveralls
38+
if: github.event_name == 'push'
39+
uses: coverallsapp/github-action@v2
40+
with:
41+
github-token: ${{ github.token }}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<img src="./images/logo.png" alt="Eiffel RemRem" width="350"/>
1919

2020
[![Sandbox badge](https://img.shields.io/badge/Stage-Sandbox-yellow)](https://github.com/eiffel-community/community/blob/master/PROJECT_LIFECYCLE.md#stage-sandbox)
21-
[![Build Status](https://travis-ci.org/eiffel-community/eiffel-remrem-semantics.svg?branch=master)](https://travis-ci.org/eiffel-community/eiffel-remrem-semantics)
21+
[![CI](https://github.com/eiffel-community/eiffel-remrem-semantics/actions/workflows/main.yml/badge.svg)](https://github.com/eiffel-community/eiffel-remrem-semantics/actions/workflows/main.yml)
2222
[![Coverage Status](https://coveralls.io/repos/github/eiffel-community/eiffel-remrem-semantics/badge.svg?branch=master)](https://coveralls.io/github/eiffel-community/eiffel-remrem-semantics?branch=master)
2323
[![](https://jitpack.io/v/eiffel-community/eiffel-remrem-semantics.svg)](https://jitpack.io/#eiffel-community/eiffel-remrem-semantics)
2424

pom.xml

+38
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,44 @@
260260
</includes>
261261
</configuration>
262262
</plugin>
263+
<plugin>
264+
<groupId>org.jacoco</groupId>
265+
<artifactId>jacoco-maven-plugin</artifactId>
266+
<version>${jacoco-maven-plugin.version}</version>
267+
<executions>
268+
<execution>
269+
<id>prepare-agent</id>
270+
<goals>
271+
<goal>prepare-agent</goal>
272+
</goals>
273+
</execution>
274+
<execution>
275+
<id>report</id>
276+
<phase>prepare-package</phase>
277+
<goals>
278+
<goal>report</goal>
279+
</goals>
280+
</execution>
281+
<execution>
282+
<id>post-unit-test</id>
283+
<phase>test</phase>
284+
<goals>
285+
<goal>report</goal>
286+
</goals>
287+
<configuration>
288+
<!-- Sets the path to the file which contains the execution data. -->
289+
<dataFile>target/jacoco.exec</dataFile>
290+
<!-- Sets the output directory for the code coverage report. -->
291+
<outputDirectory>target/jacoco-ut</outputDirectory>
292+
</configuration>
293+
</execution>
294+
</executions>
295+
<configuration>
296+
<systemPropertyVariables>
297+
<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
298+
</systemPropertyVariables>
299+
</configuration>
300+
</plugin>
263301
</plugins>
264302
</build>
265303
</project>

0 commit comments

Comments
 (0)