mbcp/.github/workflows/pytest.yml

37 lines
666 B
YAML
Raw Normal View History

2024-08-28 04:22:22 +08:00
name: pytest
on:
push:
branches:
- main
jobs:
2024-08-28 04:31:29 +08:00
RunPyTest:
2024-08-28 04:22:22 +08:00
runs-on: ubuntu-latest
2024-08-28 04:28:06 +08:00
name: Unit tests
steps:
2024-08-28 04:31:29 +08:00
- name: 配置Python
uses: actions/setup-python@v2
2024-08-28 04:28:06 +08:00
with:
2024-08-28 04:31:29 +08:00
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
2024-08-28 04:28:06 +08:00
with:
2024-08-28 04:31:29 +08:00
name: coverage