Skip to content

Commit

Permalink
Update GitHub CI to add additional summary on coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bosenqu committed Dec 27, 2023
1 parent 54b485c commit 1fa8de0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/python-app.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python application
name: Python Application CI

on:
push:
Expand Down Expand Up @@ -38,12 +38,24 @@ jobs:
path: "reports/**/*.xml"
reporter: java-junit
list-tests: "failed"
- name: Create test Summary
uses: test-summary/action@v2
if: always()
with:
paths: "reports/**/*.xml"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Create test summary
uses: test-summary/action@v2
if: always()
with:
paths: "reports/**/*.xml"
- name: Add coverage to summary
if: always()
run: |
echo "**Test Coverage Summary**" >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
cat reports/coverage_report.txt >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Mypy Coverage Summary**" >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
cat reports/mypy/index.txt >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test-ci:
-m behave -v --junit --junit-directory=$(REPORTS)/feature_tests
$(PYTHON) -m coverage combine $(REPORTS)/*/*.dat
$(PYTHON) -m coverage xml
$(PYTHON) -m coverage report
$(PYTHON) -m coverage report > $(REPORTS)/coverage_report.txt

# Run isort, ruff, and reformat-gherkin formatter
.PHONNY: format
Expand All @@ -71,7 +71,6 @@ lint-ci:
$(VENV)/bin/reformat-gherkin --check tests/features
rm -rf $(REPORTS)/mypy
$(PYTHON) -m mypy --txt-report $(REPORTS)/mypy .
cat $(REPORTS)/mypy/index.txt

# Clean project
.PHONNY: clean
Expand Down

0 comments on commit 1fa8de0

Please sign in to comment.