name: Calculus Animator CI on: push: branches: [ main, master ] pull_request: branches: [ main, master ] jobs: lint-and-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.10' cache: 'pip' - name: Set up Node uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' - name: Install Python dependencies run: | python -m pip install --upgrade pip pip install .[dev] # `npm ci` installs the exact transitive graph captured in # package-lock.json and fails if the lockfile is out of sync with # package.json — gives us reproducible eslint runs across CI shards # without drift between commits. - name: Install JS lint dependencies run: npm ci --no-audit --no-fund # Ruff is gated on the F (correctness) family across the whole repo; # tools/ and slide_renderer/ trees carry pre-existing baseline E/W style # and ANN/BLE/etc. advisory debt tracked separately and not on the OSS POC # critical path. Mypy is gated on api + core + ai_tutor (the actively # maintained packages); tools/ and slide_renderer/ have pre-existing typing # debt deferred to a future broader cleanup. - name: Lint with Ruff (correctness) run: ruff check . --select F # ESLint flat config (eslint.config.js) lints the vanilla-JS UI modules # under ui/js/. ui/vendor/ (KaTeX/MathLive) and ai_tutor/tutor-panel.js # are excluded. Gated only on errors; advisory warnings (no-unsanitized # on innerHTML routed through utils.esc / utils.prettyText, etc.) are # surfaced as output but do not fail the build. - name: Lint JS with ESLint run: npm run lint - name: Type check with Mypy run: mypy api core ai_tutor - name: Run Tests run: | # Note: We skip GUI/Pygame tests in CI as they require a display buffer pytest -m "not gui"