Fix Render deploy timeout: lazy-load model on first request instead o… #23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: [push, pull_request, workflow_dispatch] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: pip-${{ runner.os }}-3.11-${{ hashFiles('requirements.txt') }} | |
| - run: pip install ruff | |
| - run: ruff check src/ tests/ --exit-zero | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: pip-${{ runner.os }}-3.11-${{ hashFiles('requirements.txt') }} | |
| - run: pip install -r requirements.txt | |
| - run: python -m pytest tests/ -v --tb=short --cov=src --cov-fail-under=60 | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| needs: [lint, test] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker build -t demand-forecasting:ci . | |
| - name: Verify image | |
| run: docker run --rm demand-forecasting:ci python -c "print('Image OK')" |