File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Benchmark
2+
3+ on :
4+ pull_request :
5+ branches : ["main"]
6+
7+ jobs :
8+ benchmark :
9+ runs-on : ubuntu-latest
10+ env :
11+ BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
12+ steps :
13+ - uses : actions/checkout@v6
14+ with :
15+ submodules : true
16+ - uses : astral-sh/setup-uv@v8.1.0
17+ - run : uv sync --frozen --all-extras
18+ - name : Run benchmarks
19+ id : run-benchmarks
20+ run : |
21+ uv run python scripts/benchmark.py --branch $BRANCH_NAME
22+ - uses : actions/upload-artifact@v7
23+ with :
24+ name : benchmark-${{ matrix.target.name }}
25+ path : ${{ steps.run-benchmarks.outputs.report_file }}
Original file line number Diff line number Diff line change @@ -42,19 +42,19 @@ jobs:
4242 python-version : ${{ matrix.python-version }}
4343 - run : uv sync --all-extras
4444
45- - name : Run tests without cloudpathlib
45+ - name : Run non-cloud tests
4646 run : |
4747 uv run pytest \
48- -m "not cloud" \
48+ -m "not cloud and not benchmark " \
4949 --junitxml=pytest-cloudless.xml \
5050 --cov-report=xml:coverage.xml \
51- --cov bids2table \
51+ --cov= bids2table \
5252 tests
5353
54- - name : Run tests with cloudpathlib
54+ - name : Run cloud tests
5555 run : |
5656 uv run pytest \
57- -m "cloud" \
57+ -m "cloud and not benchmark " \
5858 --junitxml=pytest-cloud.xml \
5959 --cov-report=xml:coverage.xml \
6060 --cov=bids2table \
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ htmlcov
2626
2727# Local data and scratch
2828.scratch
29+ benchmarks /
2930
3031# Local virtual environment
3132.venv
Original file line number Diff line number Diff line change @@ -37,8 +37,10 @@ pybids = ["pandas>=2.0.0"]
3737[dependency-groups ]
3838dev = [
3939 " pdoc>=16.0.0" ,
40+ " polars>=1.40.1" ,
4041 " pre-commit>=4.6.0" ,
4142 " pytest>=9.0.3" ,
43+ " pytest-benchmark>=5.2.3" ,
4244 " pytest-cov>=7.1.0" ,
4345 " ruff>=0.15.13" ,
4446]
@@ -68,4 +70,8 @@ lint.extend-select = ["I"]
6870[tool .pytest .ini_options ]
6971log_cli = true
7072log_cli_level = " INFO"
71- markers = [" cloud: Tests requiring cloud group dependencies" ]
73+ addopts = " --import-mode=importlib"
74+ markers = [
75+ " benchmark: Tests used for benchmarking" ,
76+ " cloud: Tests requiring cloud group dependencies" ,
77+ ]
You can’t perform that action at this time.
0 commit comments