File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1818 env :
1919 PYTHON_PROJECT_PATH : ${GITHUB_WORKSPACE}/reportsizedeltas
2020 PYTHON_PROJECT_TESTS_PATH : ${GITHUB_WORKSPACE}/reportsizedeltas/tests
21+ COVERAGE_DATA_FILENAME : coverage.xml
2122
2223 steps :
2324 - name : Checkout
@@ -39,14 +40,18 @@ jobs:
3940 pip install --quiet pep8-naming
4041 flake8 --config "${{ env.PYTHON_PROJECT_PATH }}/.flake8" --show-source "${{ env.PYTHON_PROJECT_PATH }}"
4142
42- - name : Run Python unit tests and report code coverage
43+ - name : Run Python unit tests and record code coverage data
4344 run : |
4445 export PYTHONPATH="${{ env.PYTHON_PROJECT_PATH }}"
4546 coverage run --source="${{ env.PYTHON_PROJECT_PATH }}" --module pytest "${{ env.PYTHON_PROJECT_TESTS_PATH }}"
46- # Display code coverage report in workflow run log
47- coverage report
47+ # Generate coverage data file for consumption by `codecov/codecov-action`.
48+ coverage xml -o "${{ github.workspace }}/${{ env.COVERAGE_DATA_FILENAME }}"
49+
50+ - name : Display code coverage report
51+ run : coverage report
4852
4953 - name : Upload coverage report to Codecov
50- uses : codecov/codecov-action@v1
54+ uses : codecov/codecov-action@v2
5155 with :
56+ file : ${{ env.COVERAGE_DATA_FILENAME }}
5257 fail_ci_if_error : true
You can’t perform that action at this time.
0 commit comments