Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Test update comment #15

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
13 changes: 11 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,24 @@ jobs:

- name: Jacoco Report to PR
id: jacoco
uses: madrapps/jacoco-report@v1.1
uses: madrapps/jacoco-report@v1.3
with:
path: ${{ github.workspace }}/build/reports/jacoco/testCoverage/testCoverage.xml
paths: ${{ github.workspace }}/build/reports/jacoco/testCoverage/testCoverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 40
min-coverage-changed-files: 60
debug-mode: false
title: Code Coverage
update-comment: true

- name: Get the Coverage info
run: |
echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"

- name: Fail PR if overall coverage is less than 80%
if: ${{ steps.jacoco.outputs.coverage-overall < 80.0 }}
uses: actions/github-script@v6
with:
script: |
core.setFailed('Overall coverage is less than 80%!')
8 changes: 8 additions & 0 deletions src/main/java/com/madrapps/jacoco/operation/StringOp.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ public boolean endsWith(String source, String chars) {
public boolean startsWith(String source, String chars) {
return source.startsWith(chars);
}

public boolean isEmpty(String source) {
return source.isEmpty();
}

public String toUpperCase(String source) {
return source.toUpperCase();
}
}
8 changes: 8 additions & 0 deletions src/main/kotlin/com/madrapps/jacoco/Math.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,12 @@ class Arithmetic {
fun area(a: Int, b: Int): Int {
return a * b
}

fun negative(a: Int): Int {
return -a
}

fun positive(a: Int): Int {
return a
}
}