codecov-action
codecov-action copied to clipboard
V2 not picking up C++/catch2 outputs
Tried updating to V2 in my actions for a C++ project which uses catch2 for tests. This change broke the coverage upload, because no files were found:
==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (ca88335829e3a5b589674a200fdd1dae8f2ef27775647bc3aef6677266a6fda2 codecov)
==> Running version latest
==> Running version v0.1.17
[command]/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov -n catch2-tests -Q github-action-2.1.0 -Z
[2022-03-05T08:10:08.046Z] ['info']
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
Codecov report uploader 0.1.17
[2022-03-05T08:10:08.052Z] ['info'] => Project root located at: /home/runner/work/***/***
[2022-03-05T08:10:08.054Z] ['info'] -> Token found by environment variables
[2022-03-05T08:10:08.060Z] ['info'] Searching for coverage files...
[2022-03-05T08:10:08.095Z] ['info'] Warning: Some files located via search were excluded from upload.
[2022-03-05T08:10:08.095Z] ['info'] If Codecov did not locate your files, please review https://docs.codecov.com/docs/supported-report-formats
[2022-03-05T08:10:08.095Z] ['error'] There was an error running the uploader: No coverage files located, please try use `-f`, or change the project root with `-R`
##[error]Codecov: Failed to properly upload: The process '/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov' failed with exit code 255
Post job cleanup.
[command]/usr/bin/git version
git version 2.35.1
[command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
[command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
http.https://github.com/.extraheader
[command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
Cleaning up orphan processes
I suspext this is due to the breaking change of. not digesting any format. How to adapt the CI so that I get the correct xml/other files for your upload to work? Ie. what would be a needed change in the running of tests or an extra CI step that does the conversion that was implicit in V1?
My CI looks as follows:
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Install
run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test - Catch2
run: ./build/bin/unit_tests
- name: Test - Python
working-directory: ${{github.workspace}}
run: pytest --cov python
- name: coverage report with branches
run: gcovr -r . -f include -f src -b
- name: CodeCov upload
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: catch2-tests
fail_ci_if_error: true
Which breaks if I change to codecov/codecov-action@v1.
The python tests should just get --cov-report=xml I guess, but what do I do for the catch2 tests?
may relate to #577 and #654
@stenczelt please open a topic in our community boards if this is still an issue. I think you may need to run coverage xml after you run python coverage, but this was also built into v3