Skip to content

Commit 560fd0a

Browse files
authored
Merge pull request #73 from childmindresearch/maint/ci
Update CI cov
2 parents c1d67b2 + 040d09a commit 560fd0a

3 files changed

Lines changed: 43 additions & 31 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 & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from pytest import LogCaptureFixture
88

99
import bids2table._indexing as indexing
10-
from bids2table._pathlib import cloudpathlib_is_available
1110

1211
BIDS_EXAMPLES = Path(__file__).parents[1] / "bids-examples"
1312

@@ -52,9 +51,7 @@ def test_find_bids_datasets():
5251
assert datasets_no_derivatives == expected_datasets_no_derivatives
5352

5453

55-
@pytest.mark.skipif(
56-
not cloudpathlib_is_available(), reason="cloudpathlib not installed"
57-
)
54+
@pytest.mark.cloud
5855
def test_find_bids_datasets_s3():
5956
root = "s3://openneuro.org"
6057
datasets = list(islice(indexing.find_bids_datasets(root, maxdepth=2), 10))
@@ -80,9 +77,7 @@ def test_index_dataset(root: str, expected_count: int):
8077
assert len(table) == expected_count
8178

8279

83-
@pytest.mark.skipif(
84-
not cloudpathlib_is_available(), reason="cloudpathlib not installed"
85-
)
80+
@pytest.mark.cloud
8681
def test_index_dataset_s3():
8782
root = "s3://openneuro.org/ds000102"
8883
expected_count = 130

tests/test_metadata.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import pytest
44

55
from bids2table._metadata import load_bids_metadata
6-
from bids2table._pathlib import cloudpathlib_is_available
76

87
BIDS_EXAMPLES = Path(__file__).parents[1] / "bids-examples"
98

@@ -24,9 +23,7 @@ def test_load_bids_metadata(inherit: bool):
2423
assert metadata == expected_metadata
2524

2625

27-
@pytest.mark.skipif(
28-
not cloudpathlib_is_available(), reason="cloudpathlib not installed"
29-
)
26+
@pytest.mark.cloud
3027
def test_load_bids_metadata_s3():
3128
path = (
3229
"s3://openneuro.org/ds000102/sub-01/func/sub-01_task-flanker_run-1_bold.nii.gz"

0 commit comments

Comments
 (0)