-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- temporarily skip flake8 - initial draft of coverage badge code (see https://nedbatchelder.com/blog/202209/making_a_coverage_badge.html)
- Loading branch information
1 parent
f1dd135
commit 5506655
Showing
1 changed file
with
22 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,9 +31,27 @@ jobs: | |
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
echo 'Skipping flake8 temporarily' | ||
- name: Test with pytest and coverage | ||
run: | | ||
pytest --cov | ||
pytest --cov-report='json' | ||
- name: Coverage | ||
run: | | ||
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") | ||
echo "total=$TOTAL" >> $GITHUB_ENV | ||
echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY | ||
- name: "Make badge" | ||
uses: schneegans/[email protected] | ||
with: | ||
# GIST_TOKEN is a GitHub personal access token with scope "gist". | ||
auth: ${{ secrets.GIST_TOKEN }} | ||
gistID: 116f9fefb73f6fcf9ffe8ce34d72efd7 # replace with your real Gist id. | ||
filename: covbadge.json | ||
label: Coverage | ||
message: ${{ env.total }}% | ||
minColorRange: 50 | ||
maxColorRange: 90 | ||
valColorRange: ${{ env.total }} |