EnergyVenom's picture
Patchwise Agent Studio: Oracle AI Agent Studio cycles
af1bee9 verified
Raw History Blame Contribute Delete
4.43 kB
# Quality gates on every push and pull request: lint, type-check, unit and API tests, web build, dependency scans.
# The container image is built and smoke-tested separately (image.yml, on main).
name: CI
on:
push:
pull_request:
workflow_dispatch: {}
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
backend:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
cache-dependency-path: |
coworker/requirements.txt
architecture/requirements.txt
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install
run: |
pip install -r coworker/requirements.txt ruff==0.14.0 pip-audit coverage
(cd mock-app && npm ci --omit=dev --no-audit --no-fund)
- name: Lint (ruff)
run: ruff check coworker triage reports qa
- name: Tests with coverage
env:
PLAYWRIGHT_MODE: stub
run: |
coverage run -m pytest coworker/tests triage/tests -q -p no:cacheprovider
coverage report --skip-empty | tail -1
coverage xml -o coverage.xml
- name: Dependency scan (Python)
run: pip-audit -r coworker/requirements.txt -r architecture/requirements.txt
- uses: actions/upload-artifact@v4
if: always()
with:
name: backend-coverage
path: coverage.xml
web:
runs-on: ubuntu-latest
timeout-minutes: 20
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
- run: npm ci --no-audit --no-fund
env:
HUSKY: "0" # no git hooks in CI checkouts
- name: Type-check, lint and build
run: npm run build
- name: Unit tests
run: npx vitest run --testTimeout=30000
- name: Dependency scan (npm, production dependencies)
# react-router 6.x has two moderate advisories fixed only in 7.x (see docs/AUDIT.md S13); fail on high or worse
run: npm audit --omit=dev --audit-level=high
web-e2e:
# the web app driven in a real browser against the real backend (stub test mode): the end-to-end flow and the
# accessibility gate (axe: no serious or critical violation on any main screen, 1280/375 px, light/dark).
# Visual regression and Lighthouse stay local gates (docs/QUALITY.md): their baselines and scores depend on the machine.
runs-on: ubuntu-latest
timeout-minutes: 40
needs: web
env:
HUSKY: "0"
PLAYWRIGHT_MODE: stub
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
cache-dependency-path: coworker/requirements.txt
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: web/package-lock.json
- name: Install backend, practice app and web app
run: |
pip install -r coworker/requirements.txt
(cd mock-app && npm ci --omit=dev --no-audit --no-fund)
(cd web && npm ci --no-audit --no-fund && npm run build && npx playwright install --with-deps chromium)
- name: End-to-end flow
working-directory: web
run: npm run e2e
- name: Accessibility gate (axe)
working-directory: web
run: npm run test:a11y
- uses: actions/upload-artifact@v4
if: failure()
with:
name: web-e2e-report
path: web/playwright-report
automation-and-practice-app:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Type-check the Playwright automation
working-directory: automation
run: npm ci --no-audit --no-fund && npx tsc --noEmit -p .
- name: Dependency scans
run: |
(cd automation && npm audit --omit=dev --audit-level=high)
(cd mock-app && npm ci --omit=dev --no-audit --no-fund && npm audit --omit=dev --audit-level=high)