Spaces:
Configuration error
Configuration error
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| PIP_DISABLE_PIP_VERSION_CHECK: "1" | |
| PYTHONDONTWRITEBYTECODE: "1" | |
| jobs: | |
| python-quality: | |
| name: Python quality (ruff + mypy) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| cache-dependency-path: | | |
| requirements.txt | |
| requirements-dev.txt | |
| requirements-eval.txt | |
| pyproject.toml | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-dev.txt -r requirements-eval.txt | |
| pip install -e . | |
| - name: Ruff lint | |
| run: ruff check src/captioning backend scripts tests | |
| - name: Ruff format check | |
| run: ruff format --check src/captioning backend scripts tests | |
| - name: Mypy | |
| env: | |
| MYPYPATH: src:backend | |
| run: mypy --explicit-package-bases --namespace-packages src/captioning backend/app scripts | |
| python-tests: | |
| name: pytest (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| cache-dependency-path: | | |
| requirements.txt | |
| requirements-dev.txt | |
| requirements-eval.txt | |
| pyproject.toml | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-dev.txt -r requirements-eval.txt | |
| pip install -e . | |
| - name: Run pytest | |
| run: pytest tests backend/app/tests -v --maxfail=5 | |
| notebook-freeze: | |
| name: Notebook SHA-256 freeze | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Verify IEEE notebook is byte-stable | |
| run: make freeze-paper-notebook | |
| frontend: | |
| name: Frontend (lint + build) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm install --no-audit --no-fund | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build | |