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

feat: add fail-on-error option #184

Merged
merged 2 commits into from
Jul 13, 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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ The action's step needs to run after your test suite has outputted an LCOV file.
| `compare-sha` | _optional_ | Commit SHA to compare coverage with. |
| `debug` | _optional_ | Default: `false`. Set to `true` to enable debug logging. |
| `measure` | _optional_ | Default: `false`. Set to `true` to enable time time measurement logging. |
| `fail-on-error` | _optional_ | Default: `true`. Set to `false` to avoid CI failure when upload fails due to any errors. |

### Outputs:

Expand Down
11 changes: 10 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ inputs:
description: 'Show execution time of parsing and reporting'
required: false
default: false
fail-on-error:
description: 'Whether to fail (exit code 1) on any issues while uploading the coverage'
required: false
default: true
outputs:
coveralls-api-result:
description: 'Result status of Coveralls API post.'
Expand Down Expand Up @@ -104,7 +108,11 @@ runs:
- name: Done report
if: inputs.parallel-finished == 'true'
shell: bash
run: coveralls done ${{ inputs.debug == 'true' && '--debug' || '' }} ${{ inputs.measure == 'true' && '--measure' || '' }}
run: >-
coveralls done
${{ inputs.debug == 'true' && '--debug' || '' }}
${{ inputs.measure == 'true' && '--measure' || '' }}
${{ inputs.fail-on-error == 'false' && '--no-fail' || '' }}
env:
COVERALLS_DEBUG: ${{ inputs.debug }}
COVERALLS_CARRYFORWARD_FLAGS: ${{ inputs.carryforward }}
Expand All @@ -122,6 +130,7 @@ runs:
coveralls report
${{ inputs.debug == 'true' && '--debug' || '' }}
${{ inputs.measure == 'true' && '--measure' || '' }}
${{ inputs.fail-on-error == 'false' && '--no-fail' || '' }}
${{ inputs.allow-empty == 'true' && '--allow-empty' || '' }}
${{ inputs.base-path && format('--base-path {0}', inputs.base-path) || '' }}
${{ inputs.format && format('--format {0}', inputs.format) || '' }}
Expand Down