|
37 | 37 | required: false |
38 | 38 | type: string |
39 | 39 | default: pyproject.toml |
40 | | - secrets: |
41 | | - CC_TEST_REPORTER_ID: |
42 | | - required: true |
43 | 40 |
|
44 | 41 | env: |
45 | 42 | UV_COMPILE_BYTECODE: 1 |
@@ -69,33 +66,13 @@ jobs: |
69 | 66 | - name: Install package |
70 | 67 | run: uv pip install '.[${{ inputs.extra-dependencies }}]' |
71 | 68 |
|
72 | | - - name: Set up env for CodeClimate (push) |
73 | | - run: | |
74 | | - echo "GIT_BRANCH=${GITHUB_REF/refs\/heads\//}" >> $GITHUB_ENV |
75 | | - echo "GIT_COMMIT_SHA=$GITHUB_SHA" >> $GITHUB_ENV |
76 | | - if: github.event_name == 'push' |
77 | | - |
78 | | - - name: Set up env for CodeClimate (pull_request) |
79 | | - env: |
80 | | - PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} |
81 | | - run: | |
82 | | - echo "GIT_BRANCH=$GITHUB_HEAD_REF" >> $GITHUB_ENV |
83 | | - echo "GIT_COMMIT_SHA=$PR_HEAD_SHA" >> $GITHUB_ENV |
84 | | - if: github.event_name == 'pull_request' |
85 | | - |
86 | | - - name: Prepare CodeClimate binary |
87 | | - env: |
88 | | - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} |
89 | | - run: | |
90 | | - curl -LSs 'https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64' >./cc-test-reporter; |
91 | | - chmod +x ./cc-test-reporter |
92 | | - ./cc-test-reporter before-build |
93 | | -
|
94 | 69 | - name: Run all tests |
95 | | - run: python -m pytest ${{ inputs.pytest-options }} --cov-report xml --cov=${{ inputs.src-dir }} |
| 70 | + run: python -m pytest ${{ inputs.pytest-options }} --cov-report xml --cov-report term-missing --cov=${{ inputs.src-dir }} |
96 | 71 |
|
97 | | - - name: Push Coverage to CodeClimate |
98 | | - if: ${{ success() }} # only if tests were successful |
99 | | - env: |
100 | | - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} |
101 | | - run: ./cc-test-reporter after-build |
| 72 | + - name: Show Coverage Report to PR |
| 73 | + uses: orgoro/coverage@v3.2 |
| 74 | + if: ${{ success() }} && github.event_name == 'pull_request' # only if tests were successful, and a PR |
| 75 | + with: |
| 76 | + thresholdAll: 0.8 # we want at least 80% coverage for the package, fail if not |
| 77 | + coverageFile: coverage.xml # default when using '--cov-report xml' option above |
| 78 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments