44 branches : [ "master", "main" ]
55 pull_request :
66 branches : [ "master", "main" ]
7+
78permissions :
89 contents : read
10+
911jobs :
12+ lint :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v4
16+
17+ - name : Install uv
18+ uses : astral-sh/setup-uv@v3
19+ with :
20+ enable-cache : true
21+ cache-dependency-glob : " pyproject.toml"
22+
23+ - name : Set up Python 3.11
24+ run : |
25+ uv python install 3.11
26+ uv venv
27+
28+ - name : Install dev dependencies
29+ run : |
30+ uv pip install -e .[dev]
31+
32+ - name : Run ruff linting
33+ run : |
34+ uv run ruff check allocator/
35+
36+ - name : Run ruff formatting check
37+ run : |
38+ uv run ruff format --check allocator/
39+
40+ - name : Run mypy type checking
41+ run : |
42+ uv run mypy allocator/
43+
1044 test :
1145 runs-on : ubuntu-latest
1246 strategy :
1347 matrix :
14- python-version : ["3.10 ", "3.11 ", "3.12 "]
48+ python-version : ["3.11 ", "3.12 ", "3.13 "]
1549 steps :
1650 - uses : actions/checkout@v4
1751
@@ -26,26 +60,73 @@ jobs:
2660 uv python install ${{ matrix.python-version }}
2761 uv venv
2862
29- - name : Install dependencies
63+ - name : Install core dependencies
3064 run : |
31- uv pip install -e .
32- uv pip install pytest pytest-cov flake8
65+ uv pip install -e .[test]
3366
34- - name : Lint with flake8
67+ - name : Install optional dependencies for comprehensive testing
3568 run : |
36- # stop the build if there are Python syntax errors or undefined names
37- uv run flake8 allocator --count --select=E9,F63,F7,F82 --show-source --statistics
38- # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
39- uv run flake8 allocator --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
69+ uv pip install ortools scipy
4070
41- - name : Test with pytest
71+ - name : Test with pytest (core functionality)
4272 run : |
43- uv run pytest --cov=allocator --cov-report=xml --cov-report=term-missing -v
73+ uv run pytest allocator/tests/ --cov=allocator --cov-report=xml --cov-report=term-missing -v --tb=short
4474
4575 - name : Upload coverage to Codecov
4676 uses : codecov/codecov-action@v4
4777 if : matrix.python-version == '3.11'
4878 with :
4979 file : ./coverage.xml
5080 fail_ci_if_error : false
51- token : ${{ secrets.CODECOV_TOKEN }}
81+ token : ${{ secrets.CODECOV_TOKEN }}
82+
83+ test-algorithms :
84+ runs-on : ubuntu-latest
85+ steps :
86+ - uses : actions/checkout@v4
87+
88+ - name : Install uv
89+ uses : astral-sh/setup-uv@v3
90+ with :
91+ enable-cache : true
92+ cache-dependency-glob : " pyproject.toml"
93+
94+ - name : Set up Python 3.11
95+ run : |
96+ uv python install 3.11
97+ uv venv
98+
99+ - name : Install all optional dependencies
100+ run : |
101+ uv pip install -e .[test,algorithms,geo]
102+
103+ - name : Test advanced algorithms
104+ run : |
105+ uv run pytest allocator/tests/api/ -k "ortools or google" -v --tb=short
106+
107+ build :
108+ runs-on : ubuntu-latest
109+ needs : [lint, test]
110+ steps :
111+ - uses : actions/checkout@v4
112+
113+ - name : Install uv
114+ uses : astral-sh/setup-uv@v3
115+
116+ - name : Set up Python 3.11
117+ run : |
118+ uv python install 3.11
119+ uv venv
120+
121+ - name : Install build dependencies
122+ run : |
123+ uv pip install build
124+
125+ - name : Build package
126+ run : |
127+ python -m build
128+
129+ - name : Check package
130+ run : |
131+ uv pip install twine
132+ twine check dist/*
0 commit comments