From 8cbe963b37be1bc59b0dd75e009828208ebc36e5 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 14 May 2026 07:52:30 -0400 Subject: [PATCH] =?UTF-8?q?ci:=20add=20Forgejo=20CI=20workflow=20=E2=80=94?= =?UTF-8?q?=20backend=20lint+tests,=20frontend=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backend job spins up Postgres+pgvector and Redis as services, runs ruff, applies the initial migration to confirm it's clean, and runs pytest. Frontend job runs vue-tsc and vite build. Requires a runner labeled "fabledcurator-ci" with Python 3.14, ruff, and Node 22 pre-installed. Integration tests run locally via docker-compose with testing.Short() gating per FabledRulebook verification.md. Co-Authored-By: Claude Opus 4.7 (1M context) --- .forgejo/workflows/ci.yml | 66 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .forgejo/workflows/ci.yml diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..28ca052 --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -0,0 +1,66 @@ +name: CI + +on: + push: + branches: [dev, main] + pull_request: + branches: [main] + +jobs: + backend-lint-and-test: + # Runner must have Python 3.14 + ruff installed. Provision a runner + # labeled "fabledcurator-ci" with Python 3.14, ruff, and Node 22. + runs-on: fabledcurator-ci + services: + postgres: + image: pgvector/pgvector:pg16 + env: + POSTGRES_USER: fabledcurator + POSTGRES_PASSWORD: ci_test_password + POSTGRES_DB: fabledcurator_test + options: >- + --health-cmd "pg_isready -U fabledcurator" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + redis: + image: redis:7-alpine + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + DB_USER: fabledcurator + DB_PASSWORD: ci_test_password + DB_HOST: postgres + DB_PORT: "5432" + DB_NAME: fabledcurator_test + CELERY_BROKER_URL: redis://redis:6379/0 + CELERY_RESULT_BACKEND: redis://redis:6379/0 + SECRET_KEY: ci_test_secret_not_for_prod + steps: + - uses: actions/checkout@v4 + + - name: Install Python deps + run: pip install -r requirements.txt pytest pytest-asyncio "ruff>=0.9,<1.0" + + - name: Ruff lint + run: ruff check backend/ tests/ alembic/ + + - name: Alembic upgrade (smoke) + run: alembic upgrade head + + - name: Pytest (unit only) + run: pytest tests/ -v + + frontend-build: + runs-on: fabledcurator-ci + defaults: + run: + working-directory: frontend + steps: + - uses: actions/checkout@v4 + - run: npm ci --no-audit --no-fund + - run: npm run check + - run: npm run build