Skip to content

Commit 4be7798

Browse files
committed
Record and check coverage
1 parent b779251 commit 4be7798

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,19 @@ jobs:
9797
export WITH='--with mysqlclient'
9898
# 127.0.0.1 is to persuade mysqlclient to use tcp rather than the domain socket :-/
9999
export DB_URL=mysql://root:mysql@127.0.0.1:3306/test_db
100-
else
101-
export DB_URL=sqlite:///foo.sqlite
102100
fi
103-
uv run --all-extras --dev $WITH --resolution ${{ matrix.uv-resolution }} -m pytest --sqlalchemy-connect-url=$DB_URL
101+
uv run --all-extras --dev $WITH --resolution ${{ matrix.uv-resolution }} -m coverage run -m pytest --sqlalchemy-connect-url=$DB_URL
102+
103+
- name: Upload coverage data
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: coverage-data-${{ matrix.python-version }}-${{ matrix.uv-resolution }}-${{ matrix.database }}
107+
path: .coverage.*
108+
include-hidden-files: true
109+
if-no-files-found: ignore
110+
111+
coverage:
112+
needs: tests
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: cjw296/python-action/check-coverage@v1

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ classifiers = [
1515
"Operating System :: OS Independent",
1616
]
1717
dependencies = [
18+
"coverage>=7.8.0",
1819
"pytest>=8.0",
1920
"sqlalchemy>=1.4",
20-
"SQLAlchemy-Utils>=0.41"
21+
"SQLAlchemy-Utils>=0.41",
2122
]
2223

2324
[project.urls]
@@ -29,3 +30,6 @@ sqlalchemy = "pytest_sqlalchemy"
2930
[build-system]
3031
requires = ["setuptools>=61.0"]
3132
build-backend = "setuptools.build_meta"
33+
34+
[tool.coverage.run]
35+
source = ["pytest_sqlalchemy", "tests"]

0 commit comments

Comments
 (0)