Skip to content

wip readme: basic usage + with_strict_types tutorial #58

wip readme: basic usage + with_strict_types tutorial

wip readme: basic usage + with_strict_types tutorial #58

Workflow file for this run

name: tests
on:
push:
branches:
- '*'
paths:
- src/**
- test/**
- tox.ini
jobs:
run_tests:
name: Run project tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install tox tox-gh-actions
- name: Run tox for ${{ matrix.python-version }}
run: |
python -m tox
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: covdata-${{ matrix.python-version }}
path: .coverage.*
coverage:
name: Generate coverage status badge
needs: run_tests
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install tox tox-gh-actions
- name: Download coverage data
uses: actions/download-artifact@v4
with:
pattern: covdata-*
merge-multiple: true
- name: Combine coverage data
run: |
python -m tox -e coverage
export TOTAL_COV=$(python -c "import json; print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo total_cov=$TOTAL_COV >> $GITHUB_ENV
echo ### Total coverage: ${TOTAL_COV}% >> $GITHUB_STEP_SUMMARY
- name: Generate coverage badge
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: f6cec4c4c8e1733cfe45f807918a128a
filename: covbadge.json
label: coverage
message: ${{ env.total_cov }}%
minColorRange: 50
maxColorRange: 90
valColorRange: ${{ env.total_cov }}