bytelyst-devops-tools/dashboard/.gitea/workflows/ci.yml
Hermes VM 3ee4e7104e fix(dashboard): Phase 5 P0 — correct CI workspace path + real ESLint
- ci.yml: actions/checkout into the runner workspace instead of cd-ing into a
  hard-coded host path and `git reset --hard origin/main` on the live checkout;
  install via `pnpm install:gitea` (self-contained, no sibling common-plat
  checkout); E2E step left as a TODO pointer (ci-e2e-hardening, Phase 5 P2).
- Fix the same stale /opt/bytelyst/bytelyst-devops-tools path in deploy.sh,
  scripts/deploy-hotcopy.sh, DEPLOYMENT.md, DEPLOYMENT_GUIDE.md.
- Replace the no-op `lint` echoes with real ESLint 9 flat configs (js +
  typescript-eslint recommended) for backend and web; add a root `pnpm lint`.
- Fix the 10 errors lint surfaced, incl. require('os') in an ESM backend
  (system/repository.ts -> import * as os), prefer-const x4, and a ternary
  expression-statement in web vm/page.tsx.

Verified locally: secret-scan, lint (0 errors; correctly fails on bad code),
typecheck, unit tests (backend 9 / web 11), and build all green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 06:50:32 +00:00

101 lines
2.5 KiB
YAML

name: CI — DevOps Dashboard
on:
push:
branches: [main]
paths:
- 'backend/**'
- 'web/**'
- 'shared/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- '.pnpmfile.cjs'
- '.gitea/workflows/ci.yml'
pull_request:
paths:
- 'backend/**'
- 'web/**'
- 'shared/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- '.pnpmfile.cjs'
- '.gitea/workflows/ci.yml'
concurrency:
group: ci-devops-dashboard-${{ github.ref }}
cancel-in-progress: true
env:
# Self-contained CI: resolve @bytelyst/* deps from the local Gitea registry
# rather than a sibling learning_ai_common_plat checkout on the runner.
BYTELYST_PACKAGE_SOURCE: gitea
jobs:
build-and-test:
name: Build, Test & Typecheck
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
# Check out into the runner workspace (${{ gitea.workspace }}) instead of
# cd-ing into a hard-coded host path and `git reset --hard` on the live
# checkout. CI must never mutate an operator's working tree.
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@10.6.5 --activate
- name: Secret scan
run: pnpm secret-scan
- name: Install dependencies
run: pnpm install:gitea
- name: Lint
run: pnpm lint
- name: Typecheck
run: pnpm typecheck
- name: Build
run: pnpm build
- name: Unit tests
run: pnpm test:run
# TODO(ci-e2e-hardening): Playwright E2E needs a started stack + ops-API
# interception before it can run deterministically in CI. Tracked in
# docs/prompts/ci-e2e-hardening.md (Phase 5 P2). Re-enable once wired.
# - name: E2E tests
# run: pnpm --filter @bytelyst/devops-web test:e2e
docker-build:
name: Build Docker Images
runs-on: ubuntu-latest
needs: [build-and-test]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build backend Docker image
run: docker build -f backend/Dockerfile -t devops-backend:latest .
- name: Build web Docker image
run: docker build -f web/Dockerfile -t devops-web:latest .
- name: Test Docker Compose
run: |
docker compose up -d
sleep 10
docker compose down