Debian Codegraph @

ansible_collections/community/hashi_vault/.github/actions/ansible-codecov/action.yml

raw
1 ---
2 name: Upload Ansible coverage reports with flags
3 description: Does separate codecov uploads with flags taken from ansible-test's --group-by options
4 inputs:
5 additional-flags:
6 description: Additional custom flags (comma separated) to be added to all reports.
7 required: false
8 directory-flag-pattern:
9 description: |
10 A pattern to infer flags from directory names. For example this pattern:
11 {ansible-%}=python-{py%}={%}
12 applied to a directory name like:
13 stable-2.11=python-3.9=rando
14 Results in the flags:
15 ansible-stable-2.11,py3.9,rando
16 required: false
17 file-flag-pattern:
18 description: |
19 A pattern to infer flags from coverage reports. For example this pattern:
20 coverage={%}={target_%}={env_%}=python-{py%}.xml
21 applied to a file name like:
22 coverage=integration=lookup_some_plugin=docker-default=python-3.9.xml
23 Results in the flags:
24 integration,target_lookup_some_plugin,env_docker-default,py3.9
25 required: false
26 default: coverage={%}={target_%}={env_%}.xml
27 directory:
28 description: The directory to scan recursively. Defaults to current working directory.
29 required: false
30 codecov-uploader-version:
31 description: |
32 The version of the codecov uploader to use. 'latest' (default) always gets the latest.
33 See https://uploader.codecov.io/linux for the versions available.
34 required: false
35 default: latest
36 fail-on-error:
37 description: |
38 If 'true' then codecov will be called with '-Z', which will fail the build on an error.
39 Any value other than 'true' will be treated as false.
40 required: false
41 default: 'true'
42 runs:
43 using: composite
44 steps:
45 - name: Download and verify codecov uploader
46 shell: bash
47 run: |
48 echo "::group::Installing codecov uploader"
49
50 mkdir -p /tmp/ccbin
51 cd /tmp/ccbin
52
53 echo "/tmp/ccbin" >> ${GITHUB_PATH}
54
55 if command -v codecov ; then
56 ./codecov --version
57 else
58 gh release --repo codecov/codecov-cli download --pattern codecovcli_linux
59 mv codecovcli_linux codecov
60 chmod +x codecov
61
62 ./codecov --version
63 fi
64
65 echo "::endgroup::"
66
67 - shell: bash
68 run: >-
69 python -u "${{ github.action_path }}/process.py"
70 --directory "${{ inputs.directory }}"
71 --directory-flag-pattern "${{ inputs.file-flag-pattern }}"
72 --file-flag-pattern "${{ inputs.file-flag-pattern }}"
73 --additional-flags "${{ inputs.additional-flags }}"
74 ${{ inputs.fail-on-error == 'true' && '--fail-on-error' || '' }}