Skip to content

feat: run the caucus hub as an on-demand background service #97

feat: run the caucus hub as an on-demand background service

feat: run the caucus hub as an on-demand background service #97

Workflow file for this run

name: CI
on:
push:
branches: [main, develop, "feat/**"]
pull_request:
# Least privilege: this workflow only lints, type-checks, tests, and builds —
# it never writes to the repo. Pin GITHUB_TOKEN to read-only so a compromised
# build/test step (a malicious transitive dependency, a poisoned action) cannot
# push, tamper with releases, or mint artifacts with an over-scoped token.
permissions:
contents: read
jobs:
python:
name: Python lint, types, tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv python install 3.13
- name: Install (editable, dev extras)
run: |
uv venv
uv pip install -e ".[dev]"
- name: Ruff
run: uv run ruff check src/
- name: Mypy (strict)
run: uv run mypy src/
- name: Pytest
run: uv run pytest -q -p no:warnings
web:
name: Dashboard build and unit tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: web/package-lock.json
- name: Install
run: npm ci
- name: Build bundle
run: npm run build
- name: Unit tests (Vitest)
run: npm run test
# Note: the built bundle is committed under src/caucus/ui/ as package
# data. Vite content hashes are deterministic for a given toolchain, so
# the canonical refresh is a local `npm run build` before committing.
# A strict committed-vs-rebuilt diff is intentionally NOT enforced here
# because it is sensitive to the exact Node/Vite versions of the runner.
e2e:
name: Dashboard E2E (Playwright)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python + package
run: |
uv python install 3.13
uv venv
uv pip install -e ".[dev]"
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: web/package-lock.json
- name: Install web deps + build
working-directory: web
run: |
npm ci
npm run build
- name: Install Playwright browser
working-directory: web
run: npx playwright install --with-deps chromium
- name: Run E2E
working-directory: web
run: npm run e2e