|
14 | 14 | python-version: ${{ matrix.python-version }}
|
15 | 15 | - name: Install dependencies
|
16 | 16 | run: |
|
17 |
| - python -m pip install --upgrade pip pytest |
| 17 | + python -m pip install --upgrade pip pytest pytest-cov |
18 | 18 | pip install .
|
19 | 19 | - name: Test with pytest
|
20 | 20 | run: |
|
21 |
| - pytest tests |
| 21 | + pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=git_hg_sync tests/ | tee pytest-coverage.txt |
| 22 | + - name: Pytest coverage comment |
| 23 | + uses: MishaKav/pytest-coverage-comment@main |
| 24 | + with: |
| 25 | + pytest-coverage-path: ./pytest-coverage.txt |
| 26 | + junitxml-path: ./pytest.xml |
| 27 | + - name: Check the output coverage |
| 28 | + run: | |
| 29 | + echo "Coverage Percentage - ${{ steps.coverageComment.outputs.coverage }}" |
| 30 | + echo "Coverage Color - ${{ steps.coverageComment.outputs.color }}" |
| 31 | + echo "Coverage Html - ${{ steps.coverageComment.outputs.coverageHtml }}" |
| 32 | + echo "Coverage Warnings - ${{ steps.coverageComment.outputs.warnings }}" |
| 33 | + echo "Coverage Errors - ${{ steps.coverageComment.outputs.errors }}" |
| 34 | + echo "Coverage Failures - ${{ steps.coverageComment.outputs.failures }}" |
| 35 | + echo "Coverage Skipped - ${{ steps.coverageComment.outputs.skipped }}" |
| 36 | + echo "Coverage Tests - ${{ steps.coverageComment.outputs.tests }}" |
| 37 | + echo "Coverage Time - ${{ steps.coverageComment.outputs.time }}" |
| 38 | + echo "Not Success Test Info - ${{ steps.coverageComment.outputs.notSuccessTestInfo }}" |
| 39 | + - name: Create the Badge |
| 40 | + uses: schneegans/dynamic-badges-action@v1.7.0 |
| 41 | + with: |
| 42 | + auth: ${{ secrets.PYTEST_COVERAGE_COMMENT }} |
| 43 | + gistID: 5e90d640f8c212ab7bbac38f72323f80 |
| 44 | + filename: pytest-coverage-comment__main.json |
| 45 | + label: Coverage Report |
| 46 | + message: ${{ steps.coverageComment.outputs.coverage }} |
| 47 | + color: ${{ steps.coverageComment.outputs.color }} |
| 48 | + namedLogo: python |
0 commit comments