如何为Github设置Codecov



我得到Error: Codecov: Failed to properly upload: The process '/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov' failed with exit code 255(https://github.com/eftalgezer/SIESTAstepper/actions/runs/3077344665/jobs/4972146066)

我已将Codecov版本3更改为版本2,尝试https://github.com/codecov/codecov-action/issues/598,在GitHub Actions.yaml中配置codecov令牌对于R包,codecov在GitHub操作中失败,但什么都不起作用。

codecov.yml

python-package.yml

编辑:

我在最新版本3.1.0中收到Error: Codecov: Error validating uploader: Misformed armored text错误。(https://github.com/eftalgezer/SIESTAstepper/actions/runs/3077489502/jobs/4972389835)

编辑:

现在我得到以下错误。(https://github.com/eftalgezer/SIESTAstepper/actions/runs/3077712442/jobs/4972763464)

Run codecov/codecov-action@v3.1.0
==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (0146032e40bc0179db3afa3de179dab4da59ece0449af03d881f3c509eaabc8b  codecov)
==> Running version latest
==> Running version v0.3.1
/home/runner/work/_actions/codecov/codecov-action/v3.1.0/dist/codecov -n  -Q github-action-3.1.0 -e OS,PYTHON -f /home/runner/work/SIESTAstepper/SIESTAstepper/coverage.xml -F unittests -s ./coverage/reports/
[2022-09-18T15:42:37.909Z] ['info'] 
_____          _
/ ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _  / _` |/ _ / __/ _   / /
| |___| (_) | (_| |  __/ (_| (_)  V /
________/ __,_|___|______/ _/
Codecov report uploader 0.3.1
[2022-09-18T15:42:37.918Z] ['info'] => Project root located at: /home/runner/work/SIESTAstepper/SIESTAstepper
[2022-09-18T15:42:37.921Z] ['info'] ->  Token found by environment variables
[2022-09-18T15:42:37.928Z] ['info'] Searching for coverage files...
[2022-09-18T15:42:37.975Z] ['error'] None of the following appear to exist as files: /home/runner/work/SIESTAstepper/SIESTAstepper/coverage.xml
[2022-09-18T15:42:37.976Z] ['error'] There was an error running the uploader: Error while cleaning paths. No paths matched existing files!

覆盖率文件未创建。我用下面的代码解决了这个问题。

- name: Generate Report
run: |
pip install codecov
pip install pytest-cov
pytest --cov=./ --cov-report=xml
codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
env_vars: OS,PYTHON
files: /home/runner/work/SIESTAstepper/SIESTAstepper/coverage.xml
flags: tests

完整的代码在这里。

最新更新