File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 18
18
env :
19
19
PYTHON_PROJECT_PATH : ${GITHUB_WORKSPACE}/reportsizedeltas
20
20
PYTHON_PROJECT_TESTS_PATH : ${GITHUB_WORKSPACE}/reportsizedeltas/tests
21
+ COVERAGE_DATA_FILENAME : coverage.xml
21
22
22
23
steps :
23
24
- name : Checkout
@@ -39,14 +40,18 @@ jobs:
39
40
pip install --quiet pep8-naming
40
41
flake8 --config "${{ env.PYTHON_PROJECT_PATH }}/.flake8" --show-source "${{ env.PYTHON_PROJECT_PATH }}"
41
42
42
- - name : Run Python unit tests and report code coverage
43
+ - name : Run Python unit tests and record code coverage data
43
44
run : |
44
45
export PYTHONPATH="${{ env.PYTHON_PROJECT_PATH }}"
45
46
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
48
52
49
53
- name : Upload coverage report to Codecov
50
- uses : codecov/codecov-action@v1
54
+ uses : codecov/codecov-action@v2
51
55
with :
56
+ file : ${{ env.COVERAGE_DATA_FILENAME }}
52
57
fail_ci_if_error : true
You can’t perform that action at this time.
0 commit comments