mirror of
https://github.com/snowykami/mbcp.git
synced 2024-11-22 14:17:38 +08:00
🔥 测试工作流
This commit is contained in:
parent
2890e9c596
commit
a307913a3d
34
.github/workflows/pytest.yml
vendored
34
.github/workflows/pytest.yml
vendored
@ -6,19 +6,31 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
RunTest:
|
RunPyTest:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Unit tests
|
name: Unit tests
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: 配置Python
|
||||||
- uses: actions/setup-python@v5
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.11.4' # Define your project python version
|
python-version: '3.10'
|
||||||
- id: run-tests
|
|
||||||
uses: dima-engineer/pytest-reporter@v3
|
- 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:
|
with:
|
||||||
cov-omit-list: tests/*
|
name: coverage
|
||||||
cov-threshold-single: 85
|
|
||||||
cov-threshold-total: 90
|
|
||||||
async-tests: true
|
|
||||||
poetry-version: 1.4.2
|
|
||||||
|
Loading…
Reference in New Issue
Block a user