Skip to content

Commit 7e26715

Browse files
authored
Upload backend coverage report on failure (#39)
## Why is this change necessary? Trying to debug CI coverage failures ## How does this change address the issue? Adds step to upload HTML coverage report if failure ## What side effects does this change have? None ## How is this change tested? Downstream repo ## Other Ignoring changes to favicon and vendor files
1 parent 7a7aeaf commit 7e26715

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

copier.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ create_internal_docker_compose_network:
175175
default: no
176176
when: "{{ not deploy_as_executable }}"
177177

178+
_skip_if_exists:
179+
- backend/src/static/favicon.ico # TODO: figure out if there's another way to stop the template from overriding a changed icon
180+
178181
# Additional Settings
179182
_min_copier_version: "9.4"
180183

template/.github/workflows/ci.yaml.jinja

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,15 @@ jobs:
6363
python-version: {% endraw %}{{ python_version }}{% raw %}
6464

6565
- name: Unit test
66-
run: uv --directory=backend run pytest tests/unit --cov-report=xml --durations=5{% endraw %}{% endif %}{% raw %}
66+
run: uv --directory=backend run pytest tests/unit --durations=5
67+
68+
- name: Upload test coverage on failure
69+
if: ${{ failure() }}
70+
uses: actions/upload-artifact@{% endraw %}{{ gha_upload_artifact }}{% raw %}
71+
with:
72+
name: backend-test-coverage-${{ matrix.os }}
73+
path: backend/coverage-report-pytest
74+
if-no-files-found: error{% endraw %}{% endif %}{% raw %}
6775

6876
build-frontend:
6977
needs: [ lint, unit-test-frontend{% endraw %}{% if has_backend %}{% raw %}, unit-test-backend{% endraw %}{% endif %}{% raw %} ]

template/.pre-commit-config.yaml.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ repos:
6161
.devcontainer/devcontainer-lock.json|
6262
.copier-answers.yml|
6363
.*\.xml|
64+
.*/vendor_files/.*|
6465
)$
6566
- id: pretty-format-json
6667
exclude: |
@@ -120,6 +121,7 @@ repos:
120121
exclude: |
121122
(?x)^(
122123
.*/__snapshots__/.*|
124+
.*/vendor_files/.*|
123125
)$
124126

125127
# Invalid File Checks

0 commit comments

Comments
 (0)