Skip to content

Commit

Permalink
feat: add fail-on-error option (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox authored Jul 13, 2023
1 parent 8e1cba0 commit 12d23cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
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

0 comments on commit 12d23cc

Please sign in to comment.