-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yaml
More file actions
69 lines (65 loc) · 2.19 KB
/
Copy pathaction.yaml
File metadata and controls
69 lines (65 loc) · 2.19 KB
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
name: 'Basic Test Results'
description: 'Aggregates and processes tests files in CI. Outputs the failed tests as a comment on the PR.'
inputs:
github-token:
description: |
'The secrets.GITHUB_TOKEN to be able to interact with the current PR and comment on it.'
required: true
directory:
description: 'Directory to search for test result reports. Will run test processing on all files in the directory.'
required: false
disable-search:
description: 'Disable search for test result files. This is helpful when specifying what files you want to run test report processing with the --file option.'
required: false
exclude:
description: 'Directories to exclude from search.'
required: false
file:
description: 'Path to the junit file to run test result processing.'
required: false
version:
description: 'Specify which version of the Codecov CLI should be used. Defaults to `latest`.'
required: false
runs:
using: "composite"
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Codecov CLI
env:
VERSION: ${{ inputs.version }}
run: |
if [[ -z "${VERSION}" ]]; then
pip install codecov-cli
else
pip install codecov-cli==${VERSION}
fi
shell: bash
- name: Run Test Results Processor
if: ${{ !cancelled() }}
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
TEST_DIR: ${{ inputs.directory }}
DISABLE_SEARCH: ${{ inputs.disable-search }}
EXCLUDE: ${{ inputs.exclude }}
FILE: ${{ inputs.file }}
run: |
codecov_cli_args=()
if [[ ! -z "${TEST_DIR}" ]]; then
codecov_cli_args+=("--dir" ${TEST_DIR})
fi
if [[ ! -z "${DISABLE_SEARCH}" ]]; then
codecov_cli_args+=("--disable-search")
fi
if [[ ! -z "${EXCLUDE}" ]]; then
codecov_cli_args+=("--exclude" ${EXCLUDE})
fi
if [[ ! -z "${FILE}" ]]; then
codecov_cli_args+=("--file" ${FILE})
fi
codecovcli process-test-results --github-token ${GITHUB_TOKEN} ${codecov_cli_args[*]}
branding:
color: 'red'
icon: 'umbrella'