Skip to content

Commit deb7fb4

Browse files
committed
Update CI cov
- Combines reports - Adds additional markers for cloud vs not cloud tests
1 parent c1d67b2 commit deb7fb4

3 files changed

Lines changed: 43 additions & 20 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
name: CI
22

3+
permissions:
4+
contents: read
5+
pull-requests: write
6+
37
on:
48
push:
5-
branches: ["main"]
9+
branches: [ "main" ]
610
pull_request:
7-
branches: ["main"]
11+
branches: [ "main" ]
812

913
env:
1014
UV_FROZEN: true
15+
COVERAGE_PYTHON: "3.12"
1116

1217
jobs:
1318
format:
1419
runs-on: ubuntu-latest
1520
steps:
16-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v6
1722
with:
1823
submodules: "true"
19-
- name: Install uv
20-
uses: astral-sh/setup-uv@v5
21-
with:
22-
pyproject-file: pyproject.toml
23-
- name: Install the project
24-
run: uv sync --all-extras
24+
- uses: astral-sh/setup-uv@v8.1.0
25+
- run: uv sync --all-extras
2526
- name: Check quality
2627
run: |
2728
uv run ruff check bids2table tests
@@ -32,26 +33,45 @@ jobs:
3233
needs: format
3334
strategy:
3435
matrix:
35-
python-version: ["3.11", "3.12", "3.13"]
36+
python-version: [ "3.11", "3.12", "3.13", "3.14" ]
3637
steps:
37-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v6
3839
with:
3940
submodules: "true"
40-
- name: Install uv with python version
41-
uses: astral-sh/setup-uv@v6
41+
- uses: astral-sh/setup-uv@v8.1.0
4242
with:
4343
python-version: ${{ matrix.python-version }}
4444

4545
- name: Run tests without cloudpathlib
4646
run: |
47-
uv run pytest tests
47+
uv run pytest \
48+
-m "not cloud" \
49+
--junitxml=pytest-cloudless.xml \
50+
--cov-report=xml:coverage.xml \
51+
--cov bids2table \
52+
tests
53+
4854
- name: Run tests with cloudpathlib
4955
run: |
50-
uv run --all-extras pytest \
51-
--junitxml=pytest.xml \
56+
uv run --extra cloud pytest \
57+
-m "cloud" \
58+
--junitxml=pytest-cloud.xml \
5259
--cov-report=xml:coverage.xml \
53-
--cov=bids2table tests
54-
- name: Upload coverage to Codecov
55-
uses: codecov/codecov-action@v4
60+
--cov=bids2table \
61+
--cov-append \
62+
tests
63+
64+
- name: Merge JUnit XML reports
65+
run: |
66+
uvx junitparser merge \
67+
pytest-cloudless.xml \
68+
pytest-cloud.xml \
69+
pytest.xml
70+
71+
- name: Pytest coverage comment
72+
if: github.event_name == 'pull_request' && matrix.python-version ==
73+
env.COVERAGE_PYTHON
74+
uses: MishaKav/pytest-coverage-comment@v1
5675
with:
57-
token: ${{ secrets.CODECOV_TOKEN }}
76+
pytest-xml-coverage-path: ./coverage.xml
77+
junitxml-path: ./pytest.xml

tests/test_indexing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def test_find_bids_datasets():
5252
assert datasets_no_derivatives == expected_datasets_no_derivatives
5353

5454

55+
@pytest.mark.cloud
5556
@pytest.mark.skipif(
5657
not cloudpathlib_is_available(), reason="cloudpathlib not installed"
5758
)
@@ -80,6 +81,7 @@ def test_index_dataset(root: str, expected_count: int):
8081
assert len(table) == expected_count
8182

8283

84+
@pytest.mark.cloud
8385
@pytest.mark.skipif(
8486
not cloudpathlib_is_available(), reason="cloudpathlib not installed"
8587
)

tests/test_metadata.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def test_load_bids_metadata(inherit: bool):
2424
assert metadata == expected_metadata
2525

2626

27+
@pytest.mark.cloud
2728
@pytest.mark.skipif(
2829
not cloudpathlib_is_available(), reason="cloudpathlib not installed"
2930
)

0 commit comments

Comments
 (0)