Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
chrabyrd committed Apr 3, 2024
1 parent 84acf1a commit c07e318
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ jobs:
run: |
python -W default::DeprecationWarning -m coverage run manage.py test tests --pattern="*.py" --settings="tests.test_settings"
- name: Report coverage
- name: Generate report coverage
run: |
coverage report
coverage json
- name: Upload coverage report as artifact
Expand All @@ -83,18 +82,22 @@ jobs:
python-version: '3.x' # Use the latest available version
check-latest: true

- name: Retrieve baseline coverage
run: |
git fetch origin main:main
baseline_coverage=$(git show main:coverage.json | grep -o '"totals": {[^}]*' | grep -o '"percent_covered": [0-9.]*' | awk -F ': ' '{print $2}')
echo "$baseline_coverage" > .coverage_baseline
- name: Download coverage report artifact
uses: actions/download-artifact@v3
with:
name: coverage-report
path: .

- name: Report coverage
run: |
coverage report
- name: Retrieve baseline coverage
run: |
git fetch origin main:main
baseline_coverage=$(git show main:coverage.json | grep -o '"totals": {[^}]*' | grep -o '"percent_covered": [0-9.]*' | awk -F ': ' '{print $2}')
echo "$baseline_coverage" > .coverage_baseline
- name: Compare coverage with baseline
if: github.event_name == 'pull_request'
run: |
Expand Down

0 comments on commit c07e318

Please sign in to comment.