-
Notifications
You must be signed in to change notification settings - Fork 2
129 lines (103 loc) · 2.99 KB
/
ci.yml
File metadata and controls
129 lines (103 loc) · 2.99 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: CI
on:
push:
branches: [ "master", "main" ]
pull_request:
branches: [ "master", "main" ]
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Set up Python 3.11
run: |
uv python install 3.11
uv venv
- name: Install dev dependencies
run: |
uv pip install -e ".[dev]"
uv pip install types-requests pandas-stubs
- name: Run ruff linting
run: |
uv run ruff check allocator/ tests/
- name: Run ruff formatting check
run: |
uv run ruff format --check allocator/ tests/
- name: Run mypy type checking
run: |
uv run mypy allocator/ || echo "Type checking has known issues, continuing..."
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Set up Python ${{ matrix.python-version }}
run: |
uv python install ${{ matrix.python-version }}
uv venv
- name: Install core dependencies
run: |
uv pip install -e ".[test]"
- name: Install optional dependencies for comprehensive testing
run: |
uv pip install ortools scipy
- name: Test with pytest (core functionality)
run: |
uv run pytest tests/ --cov=allocator --cov-report=xml --cov-report=term-missing -v --tb=short
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: matrix.python-version == '3.11'
with:
file: ./coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
test-algorithms:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Set up Python 3.11
run: |
uv python install 3.11
uv venv
- name: Install all optional dependencies
run: |
uv pip install -e ".[test,algorithms,geo]"
- name: Test advanced algorithms
run: |
uv run pytest tests/api/ -k "ortools or google" -v --tb=short
build:
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python 3.11
run: |
uv python install 3.11
uv venv
- name: Build package
run: |
uv build
- name: Check package
run: |
uv tool run twine check dist/*