--- name: Upload Ansible coverage reports with flags description: Does separate codecov uploads with flags taken from ansible-test's --group-by options inputs: additional-flags: description: Additional custom flags (comma separated) to be added to all reports. required: false directory-flag-pattern: description: | A pattern to infer flags from directory names. For example this pattern: {ansible-%}=python-{py%}={%} applied to a directory name like: stable-2.11=python-3.9=rando Results in the flags: ansible-stable-2.11,py3.9,rando required: false file-flag-pattern: description: | A pattern to infer flags from coverage reports. For example this pattern: coverage={%}={target_%}={env_%}=python-{py%}.xml applied to a file name like: coverage=integration=lookup_some_plugin=docker-default=python-3.9.xml Results in the flags: integration,target_lookup_some_plugin,env_docker-default,py3.9 required: false default: coverage={%}={target_%}={env_%}.xml directory: description: The directory to scan recursively. Defaults to current working directory. required: false codecov-uploader-version: description: | The version of the codecov uploader to use. 'latest' (default) always gets the latest. See https://uploader.codecov.io/linux for the versions available. required: false default: latest fail-on-error: description: | If 'true' then codecov will be called with '-Z', which will fail the build on an error. Any value other than 'true' will be treated as false. required: false default: 'true' runs: using: composite steps: - name: Download and verify codecov uploader shell: bash run: | echo "::group::Installing codecov uploader" mkdir -p /tmp/ccbin cd /tmp/ccbin echo "/tmp/ccbin" >> ${GITHUB_PATH} if command -v codecov ; then ./codecov --version else gh release --repo codecov/codecov-cli download --pattern codecovcli_linux mv codecovcli_linux codecov chmod +x codecov ./codecov --version fi echo "::endgroup::" - shell: bash run: >- python -u "${{ github.action_path }}/process.py" --directory "${{ inputs.directory }}" --directory-flag-pattern "${{ inputs.file-flag-pattern }}" --file-flag-pattern "${{ inputs.file-flag-pattern }}" --additional-flags "${{ inputs.additional-flags }}" ${{ inputs.fail-on-error == 'true' && '--fail-on-error' || '' }}