codecov / codecov-action

GitHub Action that uploads coverage to Codecov :open_umbrella:
https://www.codecov.io
MIT License
1.48k stars 208 forks source link

Migration v4 -> v5 failed on do-upload #1649

Open NatsuOnFire opened 6 hours ago

NatsuOnFire commented 6 hours ago

Hi

In v4, i have this as result :

==> Running command '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov do-upload'
/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov do-upload -Z -f /home/runner/work/<file to jacoco.xml> --git-service github -n <name of the app>
info - 2024-11-14 23:09:15,926 -- ci service found: github-actions
warning - 2024-11-14 23:09:15,934 -- No config file could be found. Ignoring config.
warning - 2024-11-14 23:09:15,936 -- xcrun is not installed or can't be found.
warning - 2024-11-14 23:09:15,958 -- No gcov data found.
warning - 2024-11-14 23:09:15,959 -- coverage.py is not installed or can't be found.
info - 2024-11-14 23:09:16,020 -- Found 3 coverage files to report
info - 2024-11-14 23:09:16,020 -- > /home/runner/work/***
info - 2024-11-14 23:09:16,020 -- > /home/runner/work/***
info - 2024-11-14 23:09:16,020 -- > /home/runner/work/***
info - 2024-11-14 23:09:16,301 -- Your upload is now processing. When finished, results will be available at: *******
info - 2024-11-14 23:09:16,467 -- Process Upload complete

And in v5, I have this :

==> Running do-upload
      ./codecov --verbose do-upload -t <redacted>  --fail-on-error  --file  /home/runner/work/<file to jacoco.xml>  --git-service github  --name <name of the app>
info - 2024-11-14 23:16:46,098 -- ci service found: github-actions
debug - 2024-11-14 23:16:46,101 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
debug - 2024-11-14 23:16:46,104 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
warning - 2024-11-14 23:16:46,107 -- No config file could be found. Ignoring config.
debug - 2024-11-14 23:16:46,107 -- No codecov_yaml found
Usage: codecov do-upload [OPTIONS]
Try 'codecov do-upload -h' for help.
Error: Got unexpected extra argument (API)
==> Failed to upload
    Exiting...

The error isn't very explicit, what's missing to make it work with v5?

@codecov/report-upload

thomasrockhu-codecov commented 5 hours ago

@NatsuOnFire can you share how you are calling the action? e.g.

- uses: codecov/codecov-action@v5
  with:
    ...
yanyongyu commented 3 hours ago

I also encountered this error when using multiple env_vars:

==> Running do-upload
      ./codecov  do-upload  --env OS PYTHON_VERSION  --gcov-executable gcov  --git-service github
info - 2024-11-15 01:38:17,144 -- ci service found: github-actions
warning - 2024-11-15 01:38:17,152 -- No config file could be found. Ignoring config.
Usage: codecov do-upload [OPTIONS]
Try 'codecov do-upload -h' for help.

Error: Got unexpected extra argument (PYTHON_VERSION)

Here is my action config:

- name: Upload coverage report
  uses: codecov/codecov-action@v5
  with:
    token: ${{ secrets.CODECOV_TOKEN }}
    env_vars: OS,PYTHON_VERSION
thomasrockhu-codecov commented 2 hours ago

@yanyongyu thanks, looking into that now

thomasrockhu-codecov commented 2 hours ago

@yanyongyu https://github.com/codecov/wrapper/pull/23, this should be deployed tomorrow (following a bump of the action as well)