-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
90 lines (76 loc) · 2.61 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
name: 'Codecov coverage'
description: 'Upload coverage reports to Codecov, with glob support'
inputs:
files:
description: 'Glob pattern or list of files to find coverage files, separated by newlines.'
required: false
###
# The following inputs are copied from the Codecov action. We've omitted many of them for brevity.
###
token:
description: 'Repository Codecov token. Used to authorize report uploads'
required: false
flags:
description: 'Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)'
required: false
name:
description: 'User defined upload name. Visible in Codecov UI'
required: false
plugin:
description: 'plugins to run. Options: xcode, gcov, pycoverage. The default behavior runs them all.'
required: false
plugins:
description: 'Comma-separated list of plugins for use during upload.'
required: false
version:
description: 'Specify which version of the Codecov CLI should be used. Defaults to `latest`'
required: false
working-directory:
description: 'Directory in which to execute codecov.sh'
required: false
runs:
using: composite
steps:
- name: 'Prepare'
id: prepare
shell: bash
env:
FILES: ${{ inputs.files }}
#language=bash
run: |
disableSearch="false"
needsGlob="false"
# Disable search if files are provided
if [ -n "$FILES" ]; then
disableSearch="true"
# Needs glob if files contains a "*" character
if [[ "$FILES" == *"*"* ]]; then
needsGlob="true"
fi
fi
echo "disable-search=$disableSearch" >> $GITHUB_OUTPUT
echo "needs-glob=$needsGlob" >> $GITHUB_OUTPUT
- name: 'Glob files'
if: steps.prepare.outputs.needs-glob == 'true'
uses: tj-actions/glob@v22
id: glob
with:
files: ${{ inputs.files }}
# Do not read .gitignore as coverage files are never checked in
read-gitignore: false
# Separator for the files input
files-separator: '\n'
# Separator for the output
separator: ','
- uses: codecov/codecov-action@v4
with:
disable_search: ${{ steps.prepare.outputs.disable-search }}
files: ${{ steps.glob.outputs.paths || inputs.files }}
flags: ${{ inputs.flags }}
name: ${{ inputs.name }}
plugin: ${{ inputs.plugin }}
plugins: ${{ inputs.plugins }}
token: ${{ inputs.token }}
verbose: ${{ runner.debug }}
version: ${{ inputs.version }}
working-directory: ${{ inputs.working-directory }}