From a307913a3da079c9722ab53cdab12e12cce0f332 Mon Sep 17 00:00:00 2001 From: snowy Date: Wed, 28 Aug 2024 04:31:29 +0800 Subject: [PATCH] =?UTF-8?q?:fire:=20=E6=B5=8B=E8=AF=95=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index aa9702e..a7a6c49 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -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 \ No newline at end of file + name: coverage +