Skip to content

Commit 12d23cc

Browse files
authored
feat: add fail-on-error option (#184)
1 parent 8e1cba0 commit 12d23cc

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The action's step needs to run after your test suite has outputted an LCOV file.
3030
| `compare-sha` | _optional_ | Commit SHA to compare coverage with. |
3131
| `debug` | _optional_ | Default: `false`. Set to `true` to enable debug logging. |
3232
| `measure` | _optional_ | Default: `false`. Set to `true` to enable time time measurement logging. |
33+
| `fail-on-error` | _optional_ | Default: `true`. Set to `false` to avoid CI failure when upload fails due to any errors. |
3334

3435
### Outputs:
3536

action.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ inputs:
5959
description: 'Show execution time of parsing and reporting'
6060
required: false
6161
default: false
62+
fail-on-error:
63+
description: 'Whether to fail (exit code 1) on any issues while uploading the coverage'
64+
required: false
65+
default: true
6266
outputs:
6367
coveralls-api-result:
6468
description: 'Result status of Coveralls API post.'
@@ -104,7 +108,11 @@ runs:
104108
- name: Done report
105109
if: inputs.parallel-finished == 'true'
106110
shell: bash
107-
run: coveralls done ${{ inputs.debug == 'true' && '--debug' || '' }} ${{ inputs.measure == 'true' && '--measure' || '' }}
111+
run: >-
112+
coveralls done
113+
${{ inputs.debug == 'true' && '--debug' || '' }}
114+
${{ inputs.measure == 'true' && '--measure' || '' }}
115+
${{ inputs.fail-on-error == 'false' && '--no-fail' || '' }}
108116
env:
109117
COVERALLS_DEBUG: ${{ inputs.debug }}
110118
COVERALLS_CARRYFORWARD_FLAGS: ${{ inputs.carryforward }}
@@ -122,6 +130,7 @@ runs:
122130
coveralls report
123131
${{ inputs.debug == 'true' && '--debug' || '' }}
124132
${{ inputs.measure == 'true' && '--measure' || '' }}
133+
${{ inputs.fail-on-error == 'false' && '--no-fail' || '' }}
125134
${{ inputs.allow-empty == 'true' && '--allow-empty' || '' }}
126135
${{ inputs.base-path && format('--base-path {0}', inputs.base-path) || '' }}
127136
${{ inputs.format && format('--format {0}', inputs.format) || '' }}

0 commit comments

Comments
 (0)