-
Notifications
You must be signed in to change notification settings - Fork 75
/
action.yml
124 lines (120 loc) · 4.67 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# action.yml
name: 'Coveralls GitHub Action'
description: 'Send test coverage data to Coveralls.io for analysis, change tracking, and notifications.'
author: 'Nick Merwin (Coveralls, Inc.)'
inputs:
github-token:
description: 'Put secrets.GITHUB_TOKEN here'
required: false
default: ${{ github.token }}
path-to-lcov:
description: 'Path to lcov file [DEPRECATED]'
required: false
file:
description: 'Coverage file'
required: false
format:
description: 'Force coverage format, supported formats: lcov, simplecov, cobertura, jacoco, gcov, golang, python'
required: false
flag-name:
description: 'Job flag name, e.g. "Unit", "Functional", or "Integration". Will be shown in the Coveralls UI.'
required: false
parallel:
description: 'Set to true if you are running parallel jobs, then use "parallel-finished: true" for the last action.'
required: false
parallel-finished:
description: 'Set to true for the last action when using "parallel: true".'
required: false
carryforward:
description: 'Comma separated flags used to carryforward results from previous builds if some of the parallel jobs are missing.'
required: false
coveralls-endpoint:
description: 'Coveralls Enterprise server (more info: https://enterprise.coveralls.io)'
required: false
default: 'https://coveralls.io'
allow-empty:
description: "Don't fail when coverage report file is empty or contains no data"
required: false
default: false
base-path:
description: 'The root folder of the project that originally ran the tests'
required: false
git-branch:
description: 'Override the branch name'
required: false
git-commit:
description: 'Override the commit sha'
required: false
compare-ref:
description: 'Branch name to use as the base for coverage results'
required: false
compare-sha:
description: 'Commit SHA to use as the base for coverage results'
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: '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: |
mkdir -p ~/bin/
curl -sL https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-linux.tar.gz | tar xz -C ~/bin
echo ~/bin >> $GITHUB_PATH
- 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.allow-empty == 'true' && '--allow-empty' || '' }}
${{ 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) || '' }}
${{ inputs.format && format('--format {0}', inputs.format) || '' }}
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 }}
COVERALLS_COMPARE_REF: ${{ inputs.compare-ref }}
COVERALLS_COMPARE_SHA: ${{ inputs.compare-sha }}