Skip to content

Commit 045a251

Browse files
authored
feat: add allow-empty option (#165)
1 parent 65265ed commit 045a251

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The action's step needs to run after your test suite has outputted an LCOV file.
2222
| `parallel-finished` | _optional_ | Set to true in the last job, after the other parallel jobs steps have completed, this will send a webhook to Coveralls to set the build complete. |
2323
| `carryforward` | _optional_ | Comma separated flags used to carryforward results from previous builds if some of the parallel jobs are missing. Used only with `parallel-finished`. |
2424
| `coveralls-endpoint` | _optional_ | Hostname and protocol: `https://<host>`; Specifies a [Coveralls Enterprise](https://enterprise.coveralls.io/) hostname. |
25+
| `allow-empty` | _optional_ | Default: `false`. Don't fail if coverage report is empty or contains no coverage data. |
2526
| `base-path` | _optional_ | Path to the root folder of the project the coverage was collected in. Should be used in monorepos so that coveralls can process the LCOV correctly (e.g. packages/my-project) |
2627
| `git-branch` | _optional_ | Default: GITHUB_REF environment variable. Override the branch name. |
2728
| `git-commit` | _optional_ | Default: GITHUB_SHA environment variable. Override the commit SHA. |

action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ inputs:
3232
description: 'Coveralls Enterprise server (more info: https://enterprise.coveralls.io)'
3333
required: false
3434
default: 'https://coveralls.io'
35+
allow-empty:
36+
description: "Don't fail when coverage report file is empty or contains no data"
37+
required: false
38+
default: false
3539
base-path:
3640
description: 'The root folder of the project that originally ran the tests'
3741
required: false
@@ -70,7 +74,10 @@ runs:
7074
- name: Install coveralls reporter (Linux)
7175
if: runner.os == 'Linux'
7276
shell: bash
73-
run: curl -sL https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-linux.tar.gz | tar xz -C /usr/local/bin
77+
run: |
78+
mkdir -p ~/bin/
79+
curl -sL https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-linux.tar.gz | tar xz -C ~/bin
80+
echo ~/bin >> $GITHUB_PATH
7481
7582
- name: Install coveralls reporter (Windows)
7683
if: startsWith(runner.os, 'Windows')
@@ -100,6 +107,7 @@ runs:
100107
run: >-
101108
coveralls
102109
${{ inputs.debug == 'true' && '--debug' || '' }}
110+
${{ inputs.allow-empty == 'true' && '--allow-empty' || '' }}
103111
${{ inputs.base-path && format('--base-path {0}', inputs.base-path) || '' }}
104112
${{ (inputs.file || inputs.path-to-lcov) && format('--file {0}', inputs.file || inputs.path-to-lcov) || '' }}
105113
${{ inputs.format && format('--format {0}', inputs.format) || '' }}

0 commit comments

Comments
 (0)