Merge pull request #32 from dimagi/cs/new_release #29
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: coverage | |
on: | |
push: | |
branches: [main] | |
jobs: | |
update-coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Setup | |
run: | | |
python --version | |
pip install --upgrade pip wheel | |
pip install django pynose coverage | |
- name: Run coverage | |
run: | | |
coverage run -m nose | |
# .coverage.* files are ignored by git | |
coverage report -m | tee .coverage.out | |
percent=$(grep -E '^TOTAL\s.+\s[0-9]{1,3}%$' .coverage.out \ | |
| awk '{gsub("%$", "", $NF); print($NF)}') | |
python scripts/make-coverage-badge.py -o .coverage.svg "$percent" | |
- name: Update coverage badge | |
env: | |
COVERAGE_BADGE_BRANCH: coverage-badge | |
run: | | |
git config --global user.email "devops@dimagi.com" | |
git config --global user.name "$GITHUB_ACTOR" | |
bash scripts/update-coverage-badge.sh "$COVERAGE_BADGE_BRANCH" |