- .github/workflows/ci.yml: two jobs — frontend (tsc --noEmit, lint, build, Playwright) and backend (Postgres 16 + odoo:19 --test-enable --test-tags encoach_api) — catches regressions before merge. - docs/adr/: start an Architecture Decision Record trail with 0001 canonical directory layout, 0002 JWT refresh flow, 0003 paginated response envelope, 0004 RAG metadata + chunking. - docs/PROJECT_SUMMARY.md §21 Hardening Release: full recap of the AI quality loop, compliance, Paymob, i18n, and CI work shipped in this drop, plus new DB tables, REST routes, frontend routes, verification results, and operator-facing configuration. - README.md refreshed for the v4 split-repo doctrine and the new feature surface. - new_project/DEPRECATED.md: formal retirement notice pointing at backend/ as the canonical tree. Made-with: Cursor
110 lines
3.0 KiB
YAML
110 lines
3.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
pull_request:
|
|
branches: [main, develop]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
# --------------------------------------------------------------------
|
|
# Frontend: type-check, lint, build, and run Playwright smoke tests.
|
|
# --------------------------------------------------------------------
|
|
frontend:
|
|
name: Frontend — lint + build + e2e
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: frontend
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: "npm"
|
|
cache-dependency-path: frontend/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Type check
|
|
run: npx tsc --noEmit -p tsconfig.app.json
|
|
|
|
- name: Lint
|
|
run: npm run lint
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Install Playwright browsers
|
|
run: npx playwright install --with-deps chromium
|
|
|
|
- name: Run Playwright smoke tests
|
|
run: npm run test:e2e
|
|
env:
|
|
CI: "true"
|
|
|
|
- name: Upload Playwright report
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: playwright-report
|
|
path: frontend/playwright-report
|
|
retention-days: 7
|
|
|
|
# --------------------------------------------------------------------
|
|
# Backend: run the Odoo HttpCase smoke suite via the official image.
|
|
#
|
|
# The image mounts our custom_addons tree and runs the test-tagged
|
|
# subset so we don't pay for a full install on every PR.
|
|
# --------------------------------------------------------------------
|
|
backend:
|
|
name: Backend — Odoo HttpCase
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: postgres:16
|
|
env:
|
|
POSTGRES_USER: odoo
|
|
POSTGRES_PASSWORD: odoo
|
|
POSTGRES_DB: postgres
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd "pg_isready -U odoo"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Run Odoo HttpCase tests in a throwaway container
|
|
run: |
|
|
docker run --rm \
|
|
--network host \
|
|
-v "$GITHUB_WORKSPACE/backend/custom_addons:/mnt/extra-addons" \
|
|
-e HOST=localhost \
|
|
-e USER=odoo \
|
|
-e PASSWORD=odoo \
|
|
odoo:19 \
|
|
--stop-after-init \
|
|
--test-enable \
|
|
--test-tags "encoach_api" \
|
|
--log-level=warn \
|
|
--without-demo=all \
|
|
--init=encoach_api,encoach_core \
|
|
-d encoach_ci || {
|
|
echo "::warning::Odoo HttpCase suite failed — see logs above."
|
|
exit 1
|
|
}
|
|
env:
|
|
PGHOST: localhost
|
|
PGUSER: odoo
|
|
PGPASSWORD: odoo
|