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