Skip to content

Commit e4a704c

Browse files
committed
[tool] Use uv and export coverage to CodeCov
1 parent ef46dd3 commit e4a704c

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,37 @@ jobs:
1515

1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v6
1919

20-
- name: Set up Python
21-
uses: actions/setup-python@v5
20+
- name: Setup uv
21+
uses: astral-sh/setup-uv@v8.0.0
2222
with:
2323
python-version: "3.12"
2424

2525
- name: Install dependencies
2626
run: |
27-
python -m pip install --upgrade pip
28-
python -m pip install -e '.[dev]' coverage
27+
uv venv && uv pip install -e '.[dev]' coverage
2928
3029
- name: Run tests with coverage
31-
run: python -m coverage run -m unittest
30+
run: uv run python -m coverage run -m unittest
3231

3332
- name: Print coverage summary
34-
run: python -m coverage report -m --fail-under=70
33+
run: uv run python -m coverage report --cov-report=xml --junitxml -m --fail-under=70
34+
35+
- name: Upload coverage to Codecov
36+
if: ${{ !cancelled() && hashFiles('coverage.xml') != '' }}
37+
uses: codecov/codecov-action@v5
38+
with:
39+
token: ${{ secrets.CODECOV_TOKEN }}
40+
flags: connectors
41+
fail_ci_if_error: false
42+
verbose: true
43+
44+
- name: Upload test results to Codecov
45+
if: ${{ !cancelled() }}
46+
uses: codecov/codecov-action@v5
47+
with:
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
report_type: test_results
3550

3651

0 commit comments

Comments
 (0)