Skip to content

Commit a8b6539

Browse files
authored
[Chore] add coverage report (#163)
* add coverage report * restrict the coverage report from main branch
1 parent d9b8cef commit a8b6539

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ on:
3535
- 'pom.xml'
3636

3737
permissions:
38-
contents: read
38+
contents: write
3939

4040
jobs:
4141
build:
@@ -59,3 +59,17 @@ jobs:
5959

6060
- name: Build and test
6161
run: mvn -B install --file pom.xml
62+
63+
- name: Generate JaCoCo Badge
64+
if: ${{ github.ref == 'refs/heads/main' && matrix.java == 17 }}
65+
uses: cicirello/jacoco-badge-generator@v2
66+
with:
67+
jacoco-csv-file: sdk/target/site/jacoco/jacoco.csv
68+
badges-directory: sdk/target/site/jacoco
69+
70+
- name: Publish coverage report to GitHub Pages
71+
if: ${{ github.ref == 'refs/heads/main' && matrix.java == 17 }}
72+
uses: JamesIves/github-pages-deploy-action@v4
73+
with:
74+
branch: docs/coverage
75+
folder: sdk/target/site/jacoco

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
44
[![Java](https://img.shields.io/badge/java-%3E%3D17-brightgreen)](https://openjdk.org/)
55
[![Build](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/build.yml/badge.svg)](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/build.yml)
6+
[![Coverage](https://raw.githubusercontent.com/aws/aws-durable-execution-sdk-java/refs/heads/docs/coverage/jacoco.svg)](https://aws.github.io/aws-durable-execution-sdk-java/)
67
[![E2E Tests](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/e2e-tests.yml/badge.svg)](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/e2e-tests.yml)
78
[![CodeQL](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/github-code-scanning/codeql)
89
[![Spotless](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/check-spotless.yml/badge.svg)](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/check-spotless.yml)

0 commit comments

Comments
 (0)