Skip to content

Commit

Permalink
ci: apply learnings from POC
Browse files Browse the repository at this point in the history
Using https://github.com/giovanni-guidini/components-demo as a POC for these config changes.

- JSON report needs to be created separated to have the contexts information
- We have to clean up XML report before uploading the ATS one
  • Loading branch information
giovanni-guidini committed Oct 6, 2023
1 parent 6602dbd commit be42987
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ jobs:
- name: Run backend test (${{ steps.setup.outputs.matrix-instance-number }} of ${{ steps.setup.outputs.matrix-instance-total }})
run: |
make test-python-ci
coverage json -o .artifacts/python.coverage.json --show-contexts
# Upload coverage data even if running the tests step fails since
# it reduces large coverage fluctuations
Expand All @@ -112,7 +113,13 @@ jobs:
uses: ./.github/actions/artifacts
with:
token: ${{ secrets.CODECOV_TOKEN }}

# This is temporary because codecov/codecov-action@v4-beta
# Doesn't support --disable-search option
# And we don't want to upload random reports (for safety)
- name: Clean state of uploads - special case to test Codecov ATS
if: ${{ always() }}
run: rm .artifacts/python.coverage.xml
continue-on-error: true
- name: Upload coverage - special case to test Codecov ATS
if: ${{ always() }}
uses: codecov/codecov-action@v4-beta
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ test-python-ci: create-db
tests/sentry \
tests/sentry_plugins \
tests/symbolicator \
--cov . --cov-report="json:.artifacts/python.coverage.json" --cov-report="xml:.artifacts/python.coverage.xml" --cov-context=test
--cov . --cov-report="xml:.artifacts/python.coverage.xml" --cov-context=test
@echo ""


Expand Down
4 changes: 3 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ cli:
report_type: "json"
compress-pycoverage:
file_to_compress: ".artifacts/python.coverage.json"
delete_uncompressed: false
# We don't want to upload the original coverage report by accident
# Because it's too big
delete_uncompressed: true
runners:
python:
include_curr_dir: true
Expand Down

0 comments on commit be42987

Please sign in to comment.