use codecov again

This commit is contained in:
leehk 2025-04-21 13:01:00 +08:00
parent 5bb3d63adc
commit 3fa7ffe951

View File

@ -56,12 +56,12 @@ jobs:
cat Pipfile
pipenv sync -d
- name: Run tests with pytest and generate coverage report
- name: Run tests with pytest
working-directory: ${{ env.WORKING_DIR }}
run: |
pipenv run pytest --version
# Use the environment variables defined above for paths
pipenv run pytest -v -s -o log_cli=true --junitxml=results.xml --cov=${{ env.SRC_PATH }} --cov-report term ${{ env.TESTS_PATH }}
pipenv run pytest -v -s -o log_cli=true --junitxml=results.xml --cov=${{ env.SRC_PATH }} --cov-report=xml:${{ env.TESTS_COVERAGE_REPORT_PATH }} ${{ env.TESTS_PATH }}
echo "Listing results in working directory:"
ls -al ${{ github.workspace }}/${{ env.WORKING_DIR }}
@ -82,3 +82,12 @@ jobs:
with:
name: ${{ inputs.projectName }}-coverage-report
path: ${{ env.TESTS_COVERAGE_REPORT_PATH }}
- name: Upload coverage to Codecov
if: success() || failure() # always run
uses: codecov/codecov-action@v3
with:
files: ${{ env.TESTS_COVERAGE_REPORT_PATH }}
fail_ci_if_error: true