[pre-commit.ci] auto fixes from pre-commit.com hooks #280
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: CI-python | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/scientificcomputing/fenics:2023-03-01 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Upgrade pip | |
run: python3 -m pip install pip --upgrade | |
- name: Install python dependencies | |
run: python3 -m pip install ".[test,cbcbeat]" | |
- name: Run tests | |
uses: nick-fields/retry@v2 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 5 | |
command: python3 -m pytest | |
- name: Coverage report | |
run: | | |
python3 -m coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY | |
python3 -m coverage json | |
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") | |
echo "total=$TOTAL" >> $GITHUB_ENV | |
- name: Upload HTML report. | |
uses: actions/upload-artifact@v3 | |
with: | |
name: html-report | |
path: htmlcov | |
- name: Create coverage Badge | |
if: github.ref == 'refs/heads/main' | |
uses: schneegans/[email protected] | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: a7290de789564f03eb6b1ee122fce423 | |
filename: goss-badge.json | |
label: Coverage | |
message: ${{ env.total }}% | |
minColorRange: 50 | |
maxColorRange: 90 | |
valColorRange: ${{ env.total }} |