Skip to content

Commit 157caf6

Browse files
Use uv sync to set up dependencies in ci.yaml (#876)
* Revert "Revert "Use `uv sync` to set up dependencies in `ci.yaml` (#874)" (#875)" This reverts commit 9a36ebd. * Fail CI if there are codecov upload errors * Add `--cov-report=xml` for report generation
1 parent aca1baf commit 157caf6

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ jobs:
4646
- name: Setup dependencies
4747
run: |
4848
uv python pin ${{ matrix.python-version }}
49-
uv export --no-managed-python --no-group doc --resolution ${{ matrix.resolution }} > ci-requirements.txt
50-
uv pip install --system -r ci-requirements.txt
49+
uv sync --resolution ${{ matrix.resolution }}
5150
5251
- name: Run pre-commit
5352
if: matrix.pre-commit
@@ -58,28 +57,31 @@ jobs:
5857
uses: pavelzw/pytest-action@510c5e90c360a185039bea56ce8b3e7e51a16507 # v2.2.0
5958
if: matrix.pytest
6059
with:
61-
custom-arguments: --cov --junitxml=junit.xml -o junit_family=legacy
60+
custom-pytest: uv run --frozen pytest
61+
custom-arguments: --cov --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
6262

6363
- name: Run benchmarks
6464
uses: CodSpeedHQ/action@6b43a0cd438f6ca5ad26f9ed03ed159ed2df7da9 # v4.1.1
6565
if: matrix.codspeed
6666
with:
6767
mode: instrumentation
6868
token: ${{ secrets.CODSPEED_TOKEN }}
69-
run: pytest --codspeed
69+
run: uv run --frozen pytest --codspeed
7070

7171
- name: Upload coverage reports to Codecov
72-
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
72+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
7373
if: matrix.codecov
7474
with:
7575
token: ${{ secrets.CODECOV_TOKEN }}
76+
fail_ci_if_error: true
7677

7778
- name: Upload test results to Codecov
7879

79-
uses: codecov/test-results-action@44ecb3a270cd942bdf0fa8f2ce14cb32493e810a # v1.0.3
80+
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1
8081
if: matrix.codecov && !cancelled()
8182
with:
8283
token: ${{ secrets.CODECOV_TOKEN }}
84+
fail_ci_if_error: true
8385

8486
strategy:
8587
matrix:

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ minversion = "7"
158158

159159
[tool.coverage.run]
160160
source = [ "src" ]
161-
omit = [ "*/pytest-of-*/*" ]
161+
omit = [ "*/pytest-of-*/*", "*/_temp/*" ]
162162

163163
[tool.coverage.report]
164164
exclude_also = [
@@ -169,7 +169,7 @@ exclude_also = [
169169
"class .*\\bProtocol\\):",
170170
"@(abc\\.)?abstractmethod",
171171
]
172-
omit = [ "*/pytest-of-*/*" ]
172+
omit = [ "*/pytest-of-*/*", "*/_temp/*" ]
173173

174174
[tool.uv]
175175
required-version = ">=0.6.8" # Sync with README

0 commit comments

Comments
 (0)