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 pytho -m pip install pytest==8.3.2 pdm init pdm install - name: 运行测试 run: pytest - name: 生成测试报告 run: |- pytest --cov-report=xml - name: 上传测试报告 uses: actions/upload-artifact@v2 with: name: coverage