Update GitHub CI to add additional summary on coverage #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Application CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: read | |
actions: read | |
checks: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Setup virtual environment | |
run: make setup | |
- name: Install test dependencies | |
run: make install-dev | |
- name: Lint with ruff, reformat-gherkin, and mypy | |
run: make lint-ci | |
- name: Run unit and feature tests | |
run: make test-ci | |
- name: Create test report | |
uses: dorny/test-reporter@v1 | |
if: always() | |
with: | |
name: Test report | |
path: "reports/**/*.xml" | |
reporter: java-junit | |
list-tests: "failed" | |
- 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 | |
cho "```" >> $GITHUB_STEP_SUMMARY | |
cat reports/mypy/index.txt >> $GITHUB_STEP_SUMMARY | |
echo "```" >> $GITHUB_STEP_SUMMARY |