Commit aee8ba5 1 parent 3daa1f5 commit aee8ba5 Copy full SHA for aee8ba5
File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 39
39
default : " ./codecov.yml"
40
40
secrets :
41
41
CODECOV_TOKEN :
42
- required : true
42
+ description : " The token used to gain access to Codecov."
43
+ required : false
43
44
44
45
jobs :
45
46
test-py-code :
46
47
runs-on : ubuntu-latest
47
48
env :
48
49
PYPROJECT_TOML : ${{ inputs.pyproject-toml-directory }}/pyproject.toml
50
+ COVERAGE_REPORT : coverage.xml # NOTE: COVERAGE_FILE is reserved - do not use.
49
51
steps :
50
52
- name : 🛫 Checkout
51
53
uses : actions/checkout@v4
@@ -105,13 +107,16 @@ jobs:
105
107
106
108
- name : 🧪 Test Code Units
107
109
working-directory : ${{ inputs.working-directory }}
108
- run : pipenv run pytest -n=auto --cov --cov-report=xml -c=${{ env.PYPROJECT_TOML }} ${{ inputs.source-path }}
110
+ run : pipenv run pytest -n=auto --cov --cov-report=xml:${{ env.COVERAGE_REPORT }} -c=${{ env.PYPROJECT_TOML }} ${{ inputs.source-path }}
109
111
110
- # TODO: check if target is asserted
111
112
- name : 📈 Upload Coverage Reports to Codecov
113
+ # Only run step if the event is triggered from within the original repo.
114
+ # NOTE: Forked repos will not be able to set the CODECOV_TOKEN secret
115
+ if : github.event.repository.full_name == github.repository
112
116
uses : codecov/codecov-action@v4
113
117
with :
114
118
token : ${{ secrets.CODECOV_TOKEN }}
115
119
slug : ${{ inputs.codecov-slug }}
116
120
codecov_yml_path : ${{ inputs.codecov-yml-path }}
117
121
working-directory : ${{ inputs.working-directory }}
122
+ file : ${{ env.COVERAGE_REPORT }}
Original file line number Diff line number Diff line change 232
232
"justMyCode" : false ,
233
233
"presentation" : {
234
234
"hidden" : true
235
+ } ,
236
+ "env" : {
237
+ "PYTEST_ADDOPTS" : "--no-cov"
235
238
}
236
239
}
237
240
]
You can’t perform that action at this time.
0 commit comments