Skip to content

Commit

Permalink
ci: fail pr if coverage is less than 12% (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
abalias committed Mar 23, 2023
1 parent 71dc42b commit d3a2a69
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/iris-client.yml
Expand Up @@ -26,4 +26,5 @@ jobs:
with:
component-name: "Iris Client"
component-dir: "iris/client/scala-client"
measure-coverage: false
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/iris-service.yml
Expand Up @@ -26,6 +26,7 @@ jobs:
with:
component-name: "Iris Service"
component-dir: "iris/service"
measure-coverage: false
secrets: inherit
release:
if: github.event_name == 'push'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mercury-mediator.yml
Expand Up @@ -26,6 +26,7 @@ jobs:
with:
component-name: "Mercury Mediator"
component-dir: "mercury/mercury-mediator"
measure-coverage: false
secrets: inherit
release:
if: github.event_name == 'push'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/prism-node-client.yml
Expand Up @@ -26,4 +26,5 @@ jobs:
with:
component-name: "PRISM Node Client"
component-dir: "prism-node/client/scala-client"
measure-coverage: false
secrets: inherit
10 changes: 7 additions & 3 deletions .github/workflows/scala-unit-tests.yml
Expand Up @@ -9,6 +9,10 @@ on:
component-dir:
required: true
type: string
measure-coverage:
required: false
type: boolean
default: true

jobs:
build-and-unit-tests:
Expand Down Expand Up @@ -53,13 +57,13 @@ jobs:
check_name: "${{ inputs.component-name }} Test Results"

- name: Code coverage report
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && inputs.measure-coverage
uses: 5monkeys/cobertura-action@master
with:
path: "${{ inputs.component-dir }}/target/coverage/coverage-report/cobertura.xml"
report_name: "${{ inputs.component-name }} Code Coverage"
minimum_coverage: 10
fail_below_threshold: false
minimum_coverage: 12
fail_below_threshold: true
only_changed_files: true

- name: Artifact coverage HTML
Expand Down

0 comments on commit d3a2a69

Please sign in to comment.