Repository navigation
91 lines (73 loc) 路 2.28 KB
/
Copy pathcode-quality.yml
File metadata and controls
91 lines (73 loc) 路 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: code-quality
on:
pull_request:
branches:
- "*"
push:
branches:
- main
jobs:
tests:
name: Tests + prek
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Cache datasets
uses: actions/cache@v5
with:
path: ~/river_data
key: river-data-${{ hashFiles('river/datasets/**/*.py', 'river/bandit/datasets/**/*.py', 'Makefile') }}
restore-keys: |
river-data-
- name: Download datasets
run: uv run make download-datasets
# prek runs while pandas is still installed (mypy etc. type-check against it).
- name: Run prek
uses: j178/prek-action@v2
# The bulk of the suite runs without pandas, which also guards the
# optional-dependency contract. The pandas subset runs in the companion
# job below, so nothing is tested twice.
- name: Uninstall pandas
run: uv pip uninstall pandas
- name: Run tests
run: uv run --no-sync pytest
pandas:
name: Tests with pandas
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Cache datasets
uses: actions/cache@v5
with:
path: ~/river_data
key: river-data-${{ hashFiles('river/datasets/**/*.py', 'river/bandit/datasets/**/*.py', 'Makefile') }}
restore-keys: |
river-data-
- name: Download datasets
run: uv run make download-datasets
# RIVER_PANDAS_ONLY restricts collection to the pandas-dependent modules
# (see river/conftest.py).
- name: Run pandas tests
env:
RIVER_PANDAS_ONLY: "1"
run: uv run pytest
build-sdist:
name: Build sdist and wheel from sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.13"
- name: Build sdist and wheel from sdist
run: uv build