Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ci: fail pr if coverage is less than 12% #468

Merged
merged 2 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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