File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Coverage Badge
2+
3+ on :
4+ push :
5+ branches : ["main"]
6+ workflow_dispatch :
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ badge :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v4
17+
18+ - name : Set up Python
19+ uses : actions/setup-python@v5
20+ with :
21+ python-version : " 3.12"
22+ cache : " pip"
23+
24+ - name : Install dependencies
25+ run : |
26+ python -m pip install --upgrade pip
27+ python -m pip install -e ".[test]"
28+ python -m pip install coverage-badge
29+
30+ - name : Run tests with coverage
31+ run : |
32+ pytest -q --cov=fastapi_observer --cov-report=term-missing --cov-report=xml
33+
34+ - name : Generate coverage badge
35+ run : |
36+ mkdir -p assets
37+ coverage-badge -o assets/coverage.svg -f
38+
39+ - name : Commit updated badge
40+ uses : stefanzweifel/git-auto-commit-action@v5
41+ with :
42+ commit_message : " chore(ci): update coverage badge"
43+ file_pattern : assets/coverage.svg
Original file line number Diff line number Diff line change 4242 - name : Run tests via tox
4343 run : tox -e ${{ matrix.toxenv }}
4444
45- - name : Upload coverage to Codecov
46- uses : codecov/codecov-action@v5
47- with :
48- files : ./coverage.xml
49- flags : unittests
50- name : python-${{ matrix.python-version }}
51- fail_ci_if_error : false
52- token : ${{ secrets.CODECOV_TOKEN }}
53-
5445 - name : Upload coverage artifact
5546 if : always()
5647 uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change 33FastAPI Observer provides structured logging and observability helpers for FastAPI applications.
44
55[ ![ Test] ( https://github.com/MehrazRumman/fastapi-observer/actions/workflows/tests.yml/badge.svg )] ( https://github.com/MehrazRumman/fastapi-observer/actions/workflows/tests.yml )
6- [ ![ coverage] ( https://codecov.io/gh/ MehrazRumman/fastapi-observer/graph/badge .svg )] ( https://codecov.io/gh/ MehrazRumman/fastapi-observer )
6+ [ ![ coverage] ( https://raw.githubusercontent.com/ MehrazRumman/fastapi-observer/main/assets/coverage .svg )] ( https://github.com/ MehrazRumman/fastapi-observer/actions/workflows/coverage-badge.yml )
77[ ![ pypi package] ( https://img.shields.io/pypi/v/fastapi-observer?logo=pypi&label=pypi%20package )] ( https://pypi.org/project/fastapi-observer/ )
88[ ![ python] ( https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-brightgreen?logo=python&logoColor=white )] ( #python-compatibility )
99
You can’t perform that action at this time.
0 commit comments