Skip to content

Commit aee8ba5

Browse files
authored
fix pipeline (#103)
* add upload to code cov * add secret input * fail ci if error * force xml coverage report * update settings * delete fail check * Merge branch 'main' into polish_test * assert code coverage * look in current directory * files * remove intermediate steps * remove working directory * remove file name * use diff env var * fix pipeline * no cov when debugging * Merge branch 'main' into polish_test * remove script
1 parent 3daa1f5 commit aee8ba5

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/test-python-code.yaml

+8-3
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ on:
3939
default: "./codecov.yml"
4040
secrets:
4141
CODECOV_TOKEN:
42-
required: true
42+
description: "The token used to gain access to Codecov."
43+
required: false
4344

4445
jobs:
4546
test-py-code:
4647
runs-on: ubuntu-latest
4748
env:
4849
PYPROJECT_TOML: ${{ inputs.pyproject-toml-directory }}/pyproject.toml
50+
COVERAGE_REPORT: coverage.xml # NOTE: COVERAGE_FILE is reserved - do not use.
4951
steps:
5052
- name: 🛫 Checkout
5153
uses: actions/checkout@v4
@@ -105,13 +107,16 @@ jobs:
105107

106108
- name: 🧪 Test Code Units
107109
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 }}
109111

110-
# TODO: check if target is asserted
111112
- 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
112116
uses: codecov/codecov-action@v4
113117
with:
114118
token: ${{ secrets.CODECOV_TOKEN }}
115119
slug: ${{ inputs.codecov-slug }}
116120
codecov_yml_path: ${{ inputs.codecov-yml-path }}
117121
working-directory: ${{ inputs.working-directory }}
122+
file: ${{ env.COVERAGE_REPORT }}

.submodules/configs.jsonc

+3
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@
232232
"justMyCode": false,
233233
"presentation": {
234234
"hidden": true
235+
},
236+
"env": {
237+
"PYTEST_ADDOPTS": "--no-cov"
235238
}
236239
}
237240
]

0 commit comments

Comments
 (0)