codecov / codecov/codecov-action

No coverage reports found for @4, @5 using .NET's Microsoft.Testing.Platform

Open
#1,735 13 comments 1 reaction 1 assignee View on GitHub

@thomasrockhu-codecov is already working on this.

Since Jan 1, 2025.

codecov/codecov-action
Dominant language
Python
Stars
1.7k
Forks
260
Avg merge
1d 7h
Merged PRs (30d)
1

Description

I'm trying to migrate some .NET test projects to the new Microsoft.Testing.Platform runner instead of the now-old Visual Studio based runner. However, I'm having issues getting the coverage file to be found by codecov after switching.

Here's my workflow file.

- name: Publish
      run: |
          dotnet restore
          dotnet run -c Release --project src/${{ env.project_name }}.Tests/${{ env.project_name }}.Tests.csproj --coverage --coverage-output-format xml --results-directory ./coverage
    - name: Upload coverage reports to Codecov
      uses: codecov/codecov-action@v5
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        directory: ./coverage # I've also tried 'coverage' as well as not including this property at all.
        verbose: true

Here's the job output:

Publish step

  In process file artifacts produced:
    - /home/runner/work/ars/ars/coverage/1dece2dd-61a2-4761-a929-71b9b28ff08a.xml
Test run summary: Passed! - /home/runner/work/ars/ars/src/Ars.Function.Tests/bin/Release/net9.0/Ars.Function.Tests.dll (net9.0|x64)

Upload coverage reports to Codecov step

Run codecov/codecov-action@v5
Run CC_ACTION_VERSION=$(cat ${GITHUB_ACTION_PATH}/src/version)
==> Running Action version 5.1.2
Run git config --global --add safe.directory /home/runner/work/ars/ars
Run CC_FORK="false"
Run if [ "false" == 'true' ] && [ "$CC_FORK" != 'true' ];
==> Token set from input
Run if [ -z "$CC_BRANCH" ] && [ -z "$CC_TOKEN" ] && [ "$CC_FORK" == 'true' ]
Run if [ -z "$CC_SHA" ];
Run ${GITHUB_ACTION_PATH}/dist/codecov.sh
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
                            Wrapper-0.0.31
                                  
==> Detected linux
 -> Downloading https://cli.codecov.io/latest/linux/codecov
==> Finishing downloading linux:latest
      Version: v9.1.1
 
gpg: directory '/home/runner/.gnupg' created
gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
gpg: /home/runner/.gnupg/trustdb.gpg: trustdb created
gpg: key 806BB28AED779869: public key "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" imported
gpg: Total number processed: 1
gpg:               imported: 1
==> Verifying GPG signature integrity
 -> Downloading https://cli.codecov.io/latest/linux/codecov.SHA256SUM
 -> Downloading https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig
 
gpg: Signature made Sat Dec  7 16:07:53 2024 UTC
gpg:                using RSA key 27034E7FDB850E0BBC2C62FF806BB28AED779869
gpg: Good signature from "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 2703 4E7F DB85 0E0B BC2C  62FF 806B B28A ED77 9869
codecov: OK
==> CLI integrity verified
 -> Token of length 36 detected
==> Running upload-coverage
      ./codecov --verbose upload-coverage -t <redacted> --git-service github --dir coverage --gcov-executable gcov
info - 2024-12-[30](https://github.com/sendtrucks/ars/actions/runs/12540533840/job/34967933585#step:5:32) 01:38:12,971 -- ci service found: github-actions
debug - 2024-12-30 01:38:12,973 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
debug - 2024-12-30 01:38:12,974 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
debug - 2024-12-30 01:38:12,976 -- Loading config from /home/runner/work/ars/ars/.github/codecov.yml
debug - 2024-12-30 01:38:12,979 -- Starting upload coverage --- {"verbose": true, "auto_load_params_from": null, "codecov_yml_path": null, "enterprise_url": null, "version": "cli-9.1.1", "command": "upload-coverage", "git_service": "github", "files_search_root_folder": "coverage", "gcov_executable": "gcov", "commit_sha": "90ffe39a730bcc6204[31](https://github.com/sendtrucks/ars/actions/runs/12540533840/job/34967933585#step:5:33)0d20af0753c9ead27165", "fail_on_error": false, "slug": "sendtrucks/ars", "report_code": "default", "network_root_folder": "/home/runner/work/ars/ars", "files_search_exclude_folders": [], "files_search_explicitly_listed_files": [], "disable_search": false, "disable_file_fixes": false, "build_code": "1254053[38](https://github.com/sendtrucks/ars/actions/runs/12540533840/job/34967933585#step:5:41)40", "build_url": "https://github.com/sendtrucks/ars/actions/runs/12[54](https://github.com/sendtrucks/ars/actions/runs/12540533840/job/34967933585#step:5:58)0533840", "job_code": "Deploy Function App", "name": "12540533840", "branch": "main", "pull_request_number": null, "env_vars": {}, "flags": [], "plugin_names": ["xcode", "gcov", "pycoverage"], "dry_run": false, "use_legacy_uploader": false, "handle_no_reports_found": false, "report_type": "coverage",
debug - 2024-12-30 01:38:12,9[80](https://github.com/sendtrucks/ars/actions/runs/12540533840/job/34967933585#step:5:85) -- Selected preparation plugins --- {"selected_plugins": ["<class 'codecov_cli.plugins.xcode.XcodePlugin'>", "<class 'codecov_cli.plugins.gcov.GcovPlugin'>", "<class 'codecov_cli.plugins.pycoverage.Pycoverage'>"], "cli_config": {}}
debug - 2024-12-30 01:38:12,980 -- Running preparation plugin: <class 'codecov_cli.plugins.xcode.XcodePlugin'>
debug - 2024-12-30 01:38:12,980 -- Running xcode plugin...
warning - 2024-12-30 01:38:12,980 -- xcrun is not installed or can't be found.
debug - 2024-12-30 01:38:12,980 -- Running preparation plugin: <class 'codecov_cli.plugins.gcov.GcovPlugin'>
debug - 2024-12-30 01:38:12,980 -- Running gcov plugin...
warning - 2024-12-30 01:38:12,980 -- No gcov data found.
debug - 2024-12-30 01:38:12,981 -- Running preparation plugin: <class 'codecov_cli.plugins.pycoverage.Pycoverage'>
warning - 2024-12-30 01:38:12,981 -- coverage.py is not installed or can't be found.
debug - 2024-12-30 01:38:12,981 -- Collecting relevant files
info - 2024-12-30 01:38:12,988 -- Found 0 coverage files to report
Error: No coverage reports found. Please make sure you're generating reports successfully.
==> Failed to upload coverage

Any ideas what this could be?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.