Skip to content

Commit

Permalink
🔥 测试工作流
Browse files Browse the repository at this point in the history
  • Loading branch information
snowykami committed Aug 27, 2024
1 parent 2890e9c commit a307913
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,31 @@ on:
- main

jobs:
RunTest:
RunPyTest:
runs-on: ubuntu-latest
name: Unit tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: 配置Python
uses: actions/setup-python@v2
with:
python-version: '3.11.4' # Define your project python version
- id: run-tests
uses: dima-engineer/pytest-reporter@v3
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:
cov-omit-list: tests/*
cov-threshold-single: 85
cov-threshold-total: 90
async-tests: true
poetry-version: 1.4.2
name: coverage

0 comments on commit a307913

Please sign in to comment.