-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.22 KB
/
coverage.yml
File metadata and controls
62 lines (51 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Coverage Badge
on:
push:
branches: [ "master" ]
paths:
- '**.py'
- 'pyproject.toml'
- '.github/workflows/coverage.yml'
pull_request:
branches: [ "master" ]
paths:
- '**.py'
- 'pyproject.toml'
- '.github/workflows/coverage.yml'
permissions:
contents: write
jobs:
coverage:
runs-on: ubuntu-latest
services:
memcached:
image: memcached:1.6-alpine
ports:
- 11211:11211
redis:
image: redis:alpine
ports:
- 6379:6379
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Sync dependencies
run: uv sync
- name: Generate coverage report
run: |
uv run coverage run -m pytest
uv run coverage report
uv run coverage xml
uv tool run --from genbadge[coverage] genbadge coverage -i coverage.xml -o coverage.svg
- name: Upload coverage badge
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: coverage-badge
folder: .
target-folder: .
clean: false