Skip to content

Commit 9903289

Browse files
committed
Add CI workflow and a network test marker
1 parent 12f62e5 commit 9903289

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
tests:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
python-version: ["3.10", "3.11", "3.12", "3.13"]
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
cache: pip
18+
cache-dependency-path: pyproject.toml
19+
- name: Install the package with all extras
20+
run: pip install ".[netcdf,bigquery,dask,dev]"
21+
# The suite prints a COVERAGE GAP banner when an optional module
22+
# is missing and its tests silently skip. All extras are
23+
# installed above, so a banner means the pass count excludes
24+
# code this run was meant to cover; fail on it.
25+
- name: Run the suite
26+
run: |
27+
set -o pipefail
28+
pytest tests 2>&1 | tee pytest.log
29+
if grep -q "COVERAGE GAP" pytest.log; then
30+
echo "coverage gap: an optional module is missing"
31+
exit 1
32+
fi

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@ testpaths = ["tests"]
6767
markers = [
6868
"bigquery: tests that contact BigQuery; require credentials and cilresearch context",
6969
"dask: tests that spin up a real Dask LocalCluster; skipped by default to keep the suite fast",
70+
"network: tests that reach the internet; excluded by default so the suite runs offline",
7071
]
71-
addopts = "-ra --strict-markers -m 'not bigquery and not dask'"
72+
addopts = "-ra --strict-markers -m 'not bigquery and not dask and not network'"

0 commit comments

Comments
 (0)