Skip to content

Commit 17b0ffd

Browse files
committed
fix(ci): test
1 parent 15ecbc0 commit 17b0ffd

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

.github/workflows/ci.yml

+20-11
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,28 @@ on:
55
- pull_request
66

77
jobs:
8-
build:
8+
test:
99
runs-on: ubuntu-24.04
1010
strategy:
1111
matrix:
12-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
12+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1313

1414
steps:
15-
- uses: actions/checkout@v4
16-
- name: Install uv
17-
uses: astral-sh/setup-uv@v3
18-
- name: Set up Python ${{ matrix.python-version }}
19-
run: uv python install ${{ matrix.python-version }}
20-
- name: Install the project
21-
run: uv sync --all-extras --dev
22-
- name: Test with tox
23-
run: uv run tox
15+
- uses: actions/checkout@v4
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v3
18+
with:
19+
enable-cache: true
20+
cache-dependency-glob: "requirements**.txt"
21+
- name: Set up Python ${{ matrix.python-version }}
22+
run: uv python install ${{ matrix.python-version }}
23+
- name: Install dependencies
24+
run: uv sync --all-extras --dev
25+
- name: Run tests with coverage
26+
run: |
27+
uv run python -m pytest --cov=googletrans --cov-report=xml
28+
- name: Upload coverage to Codecov
29+
uses: codecov/codecov-action@v3
30+
with:
31+
files: ./coverage.xml
32+
fail_ci_if_error: true

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ classifiers = [
2424
]
2525

2626
[project.optional-dependencies]
27-
dev = ["pytest", "pytest-asyncio", "coveralls", "ruff>=0.7"]
27+
dev = ["pytest", "pytest-asyncio", "pytest-cov", "ruff>=0.7"]
2828

2929
[tool.uv]
30-
dev-dependencies = ["pytest", "pytest-asyncio", "ruff>=0.7"]
30+
dev-dependencies = ["pytest", "pytest-asyncio", "pytest-cov", "ruff>=0.7"]
3131

3232
[project.scripts]
3333
translate = "googletrans:translate"

0 commit comments

Comments
 (0)