| name: Hyperlocal ML Platform CI | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| test-backend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' | |
| - name: Install Python Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt pytest pytest-asyncio httpx lightgbm opentelemetry-api opentelemetry-sdk | |
| - name: Run Backend Pytest Test Suite | |
| run: | | |
| PYTHONPATH=. python -m pytest tests/ -v | |
| ml-benchmark: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' | |
| - name: Install Python Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt pytest pytest-asyncio httpx lightgbm opentelemetry-api opentelemetry-sdk | |
| - name: Run M5 Benchmark Evaluation | |
| run: PYTHONPATH=. python benchmarks/run_m5_eval.py | |
| - name: Assert WMAPE Lift > 0 | |
| run: | | |
| python -c " | |
| import json | |
| r = json.load(open('benchmarks/results/m5_benchmark_results.json')) | |
| assert r['wmape_lift_pct'] > 0, f'Tobit must outperform OLS. Got {r[\"wmape_lift_pct\"]:.2f}%' | |
| print(f'WMAPE lift: {r[\"wmape_lift_pct\"]:.2f}% — PASS') | |
| " | |
| - name: Upload Benchmark Results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: m5-benchmark-results | |
| path: benchmarks/results/m5_benchmark_results.json | |
| build-frontend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Install Node.js 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install Frontend Dependencies | |
| run: | | |
| cd frontend | |
| npm install | |
| - name: Compile Frontend Production Assets | |
| run: | | |
| cd frontend | |
| npm run build | |