🔥 测试工作流 #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pytest | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
RunPyTest: | |
runs-on: ubuntu-latest | |
name: Unit tests | |
steps: | |
- name: 配置Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: 安装依赖 | |
run: |- | |
python -m pip install pdm | |
pdm install --no-verbose | |
- name: 运行测试 | |
run: |- | |
pdm run pytest | |
- name: 生成测试报告 | |
run: |- | |
pdm run pytest --cov-report=xml | |
pdm run coverage xml | |
- name: 上传测试报告 | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage | |