Skip to content

Commit

Permalink
feat: use universal coverage reporter (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed Mar 6, 2023
1 parent 50c33ad commit 02ec6dc
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 49,581 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
@@ -1,4 +1,4 @@
.DS_Store
.idea
coverage
node_modules/
coveralls
65 changes: 61 additions & 4 deletions action.yml
Expand Up @@ -8,9 +8,11 @@ inputs:
required: false
default: ${{ github.token }}
path-to-lcov:
description: 'Path to lcov file'
description: 'Path to lcov file [DEPRECATED]'
required: false
file:
description: 'Coverage file'
required: false
default: './coverage/lcov.info'
flag-name:
description: 'Job flag name, e.g. "Unit", "Functional", or "Integration". Will be shown in the Coveralls UI.'
required: false
Expand All @@ -36,12 +38,67 @@ inputs:
git-commit:
description: 'Override the commit sha'
required: false
debug:
description: 'Enable debug output'
required: false
default: false
outputs:
coveralls-api-result:
description: 'Result status of Coveralls API post.'
branding:
color: 'green'
icon: 'percent'
runs:
using: 'node16'
main: './dist/index.js'
using: 'composite'
steps:
- name: Install coveralls reporter (macOS)
if: runner.os == 'macOS'
shell: bash
run: |
brew tap coverallsapp/coveralls --quiet
brew install coveralls --quiet
- name: Install coveralls reporter (Linux)
if: runner.os == 'Linux'
shell: bash
run: curl -sL https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-linux.tar.gz | tar xz -C /usr/local/bin

- name: Install coveralls reporter (Windows)
if: startsWith(runner.os, 'Windows')
shell: bash
run: |
mkdir -p ~/bin/
curl -sL https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-windows.zip | zcat > ~/bin/coveralls.exe
echo ~/bin >> $GITHUB_PATH
- name: Done report
if: inputs.parallel-finished == 'true'
shell: bash
run: coveralls --done ${{ inputs.debug == 'true' && '--debug' || '' }}
env:
COVERALLS_DEBUG: ${{ inputs.debug }}
COVERALLS_CARRYFORWARD_FLAGS: ${{ inputs.carryforward }}
COVERALLS_FLAG_NAME: ${{ inputs.flag-name }}
COVERALLS_PARALLEL: ${{ inputs.parallel }}
COVERALLS_ENDPOINT: ${{ inputs.coveralls-endpoint }}
COVERALLS_GIT_BRANCH: ${{ inputs.git-branch }}
COVERALLS_GIT_COMMIT: ${{ inputs.git-commit }}
COVERALLS_REPO_TOKEN: ${{ inputs.github-token }}

- name: Coverage report
if: inputs.parallel-finished != 'true'
shell: bash
run: >-
coveralls
${{ inputs.debug == 'true' && '--debug' || '' }}
${{ inputs.base-path && format('--base-path {0}', inputs.base-path) || '' }}
${{ (inputs.file || inputs.path-to-lcov) && format('--file {0}', inputs.file || inputs.path-to-lcov) || '' }}
env:
COVERALLS_DEBUG: ${{ inputs.debug }}
COVERALLS_CARRYFORWARD_FLAGS: ${{ inputs.carryforward }}
COVERALLS_FLAG_NAME: ${{ inputs.flag-name }}
COVERALLS_PARALLEL: ${{ inputs.parallel }}
COVERALLS_ENDPOINT: ${{ inputs.coveralls-endpoint }}
COVERALLS_GIT_BRANCH: ${{ inputs.git-branch }}
COVERALLS_GIT_COMMIT: ${{ inputs.git-commit }}
COVERALLS_REPO_TOKEN: ${{ inputs.github-token }}
1,558 changes: 0 additions & 1,558 deletions dist/LICENSE.md

This file was deleted.

0 comments on commit 02ec6dc

Please sign in to comment.