Repository navigation
67 lines (60 loc) · 1.85 KB
/
Copy pathpython.yml
File metadata and controls
67 lines (60 loc) · 1.85 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
# Python workflow for checking formatting, linting, and running tests on both Windows and Linux using GitHub Actions.
name: Python
on:
push:
branches: [ '**' ]
pull_request:
workflow_call:
permissions:
contents: read
jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
with:
submodules: true
- uses: swatinem/rust-cache@v2
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: 3.14
- uses: dtolnay/rust-toolchain@stable
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Check formatting
run: uv run ruff format --check
- name: Check linting
run: uv run ruff check
- name: Run tests
run: uv run pytest pywr-python/tests
- name: Run book listings
run: |
uv run python ./pywr-book/py-listings/agri-parameter/agri_parameter.py
uv run python ./pywr-book/py-listings/model-conversion/convert.py
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: true
- uses: swatinem/rust-cache@v2
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: 3.14
- uses: dtolnay/rust-toolchain@stable
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Check formatting
run: uv run ruff format --check
- name: Check linting
run: uv run ruff check
- name: Run tests
run: uv run pytest pywr-python/tests
- name: Run book listings
run: |
uv run python ./pywr-book/py-listings/agri-parameter/agri_parameter.py
uv run python ./pywr-book/py-listings/model-conversion/convert.py