Skip to content

Commit 02ec6dc

Browse files
authored
feat: use universal coverage reporter (#145)
1 parent 50c33ad commit 02ec6dc

14 files changed

+62
-49581
lines changed

.github/workflows/test.yml

-29
This file was deleted.

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.DS_Store
22
.idea
33
coverage
4-
node_modules/
4+
coveralls

action.yml

+61-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ inputs:
88
required: false
99
default: ${{ github.token }}
1010
path-to-lcov:
11-
description: 'Path to lcov file'
11+
description: 'Path to lcov file [DEPRECATED]'
12+
required: false
13+
file:
14+
description: 'Coverage file'
1215
required: false
13-
default: './coverage/lcov.info'
1416
flag-name:
1517
description: 'Job flag name, e.g. "Unit", "Functional", or "Integration". Will be shown in the Coveralls UI.'
1618
required: false
@@ -36,12 +38,67 @@ inputs:
3638
git-commit:
3739
description: 'Override the commit sha'
3840
required: false
41+
debug:
42+
description: 'Enable debug output'
43+
required: false
44+
default: false
3945
outputs:
4046
coveralls-api-result:
4147
description: 'Result status of Coveralls API post.'
4248
branding:
4349
color: 'green'
4450
icon: 'percent'
4551
runs:
46-
using: 'node16'
47-
main: './dist/index.js'
52+
using: 'composite'
53+
steps:
54+
- name: Install coveralls reporter (macOS)
55+
if: runner.os == 'macOS'
56+
shell: bash
57+
run: |
58+
brew tap coverallsapp/coveralls --quiet
59+
brew install coveralls --quiet
60+
61+
- name: Install coveralls reporter (Linux)
62+
if: runner.os == 'Linux'
63+
shell: bash
64+
run: curl -sL https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-linux.tar.gz | tar xz -C /usr/local/bin
65+
66+
- name: Install coveralls reporter (Windows)
67+
if: startsWith(runner.os, 'Windows')
68+
shell: bash
69+
run: |
70+
mkdir -p ~/bin/
71+
curl -sL https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-windows.zip | zcat > ~/bin/coveralls.exe
72+
echo ~/bin >> $GITHUB_PATH
73+
74+
- name: Done report
75+
if: inputs.parallel-finished == 'true'
76+
shell: bash
77+
run: coveralls --done ${{ inputs.debug == 'true' && '--debug' || '' }}
78+
env:
79+
COVERALLS_DEBUG: ${{ inputs.debug }}
80+
COVERALLS_CARRYFORWARD_FLAGS: ${{ inputs.carryforward }}
81+
COVERALLS_FLAG_NAME: ${{ inputs.flag-name }}
82+
COVERALLS_PARALLEL: ${{ inputs.parallel }}
83+
COVERALLS_ENDPOINT: ${{ inputs.coveralls-endpoint }}
84+
COVERALLS_GIT_BRANCH: ${{ inputs.git-branch }}
85+
COVERALLS_GIT_COMMIT: ${{ inputs.git-commit }}
86+
COVERALLS_REPO_TOKEN: ${{ inputs.github-token }}
87+
88+
- name: Coverage report
89+
if: inputs.parallel-finished != 'true'
90+
shell: bash
91+
run: >-
92+
coveralls
93+
${{ inputs.debug == 'true' && '--debug' || '' }}
94+
${{ inputs.base-path && format('--base-path {0}', inputs.base-path) || '' }}
95+
${{ (inputs.file || inputs.path-to-lcov) && format('--file {0}', inputs.file || inputs.path-to-lcov) || '' }}
96+
env:
97+
COVERALLS_DEBUG: ${{ inputs.debug }}
98+
COVERALLS_CARRYFORWARD_FLAGS: ${{ inputs.carryforward }}
99+
COVERALLS_FLAG_NAME: ${{ inputs.flag-name }}
100+
COVERALLS_PARALLEL: ${{ inputs.parallel }}
101+
COVERALLS_ENDPOINT: ${{ inputs.coveralls-endpoint }}
102+
COVERALLS_GIT_BRANCH: ${{ inputs.git-branch }}
103+
COVERALLS_GIT_COMMIT: ${{ inputs.git-commit }}
104+
COVERALLS_REPO_TOKEN: ${{ inputs.github-token }}

dist/LICENSE.md

-1,558
This file was deleted.

0 commit comments

Comments
 (0)