我正在尝试将代码覆盖率%徽章添加到我的repos README.md中
我目前正在使用Github actions来自动化我的pytest测试。我有它自己的工作,但我一直在努力争取覆盖率的徽章。我使用工作服的徽章生成,并基于it looks like coveralls is expecting an lcov.info file。但是,当我查看reporting options for pytest-cov时,我没有看到相应的输出选项。
我尝试过生成其他类型,比如xml,并配置来查找它,但它仍然在coverage文件夹中查找lcov.info。下面是我当前的pythonapp.yml文件。当前失败的步骤是带有它的工作服查找./coverage/lcov.info
任何关于我做错了什么或如何修复的帮助都将非常感谢。
name: tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pip install pytest pytest-cov
python -m pytest --cov=./myapp --cov-report xml
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path--to-lcov: coverage.xml发布于 2021-04-19 05:58:25
在我看来,"path- to -lcov“的参数名中有额外的连字符
根据这里的文档:https://github.com/marketplace/actions/coveralls-github-action
尝试将"path-- to -lcov“更改为"path-to-lcov”
https://stackoverflow.com/questions/60910770
复制相似问题