Conception complete (Phase 0) pour formation-hub Acadenice : - 19 docs Merise Agile + UML + GitOps + plans (tests/deploy/ops/api) cf docs/00-readme.md pour l'index complet - Stack Docker compose (Docmost + Baserow + Postgres + Redis + MinIO local FS) compose.yml + compose.staging.yml + compose.prod.yml - CI/CD GitHub Actions skeleton (ci, deploy-staging, deploy-prod) - Bridge service skeleton (Hono + TS + Biome + Vitest + zod + pino) - Templates GitHub : PR + 3 issue types + CODEOWNERS + dependabot.yml - Scripts ops : healthcheck, backup quotidien, smoke-test post-deploy - LICENSE AGPL-3.0 + SECURITY.md + CONTRIBUTING.md + CHANGELOG.md - Diagramme drawIO archi infra (XML importable dans diagrams.net) Decisions structurelles enregistrees : - Scope CFA + Agence avec entite PERSONNE pivot multi-roles (ADR-001) - Stack composite Docmost AGPL + Baserow MIT + bridge custom (ADR-001) - Path B : UX quasi-unified via Tiptap node-views custom (ADR-002) - Monorepo trunk-based development (ADR-003) - Postgres separe Docmost/Baserow (ADR-004) - Bridge stack Node 22 + Hono (ADR-005) - Repo neuf prefere a fork Docmost - Prod-like des le jour 1 (pas MVP)
145 lines
3.7 KiB
YAML
145 lines
3.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches-ignore: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
security-events: write
|
|
|
|
jobs:
|
|
lint-bridge:
|
|
name: Lint bridge (Biome)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: "npm"
|
|
cache-dependency-path: bridge/package-lock.json
|
|
- run: cd bridge && npm ci
|
|
- run: cd bridge && npx biome ci .
|
|
|
|
typecheck-bridge:
|
|
name: Type-check bridge
|
|
runs-on: ubuntu-latest
|
|
needs: lint-bridge
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: "npm"
|
|
cache-dependency-path: bridge/package-lock.json
|
|
- run: cd bridge && npm ci
|
|
- run: cd bridge && npm run typecheck
|
|
|
|
test-bridge-unit:
|
|
name: Tests unit bridge
|
|
runs-on: ubuntu-latest
|
|
needs: typecheck-bridge
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: "npm"
|
|
cache-dependency-path: bridge/package-lock.json
|
|
- run: cd bridge && npm ci
|
|
- run: cd bridge && npm run test:unit -- --coverage
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: coverage-unit
|
|
path: bridge/coverage/
|
|
|
|
test-bridge-integration:
|
|
name: Tests integration bridge
|
|
runs-on: ubuntu-latest
|
|
needs: typecheck-bridge
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
env:
|
|
POSTGRES_USER: test
|
|
POSTGRES_PASSWORD: test
|
|
POSTGRES_DB: testdb
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd "pg_isready -U test"
|
|
--health-interval 5s
|
|
--health-timeout 3s
|
|
--health-retries 10
|
|
redis:
|
|
image: redis:7-alpine
|
|
ports:
|
|
- 6379:6379
|
|
options: >-
|
|
--health-cmd "redis-cli ping"
|
|
--health-interval 5s
|
|
--health-timeout 3s
|
|
--health-retries 10
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: "npm"
|
|
cache-dependency-path: bridge/package-lock.json
|
|
- run: cd bridge && npm ci
|
|
- run: cd bridge && npm run test:integration
|
|
env:
|
|
DATABASE_URL: postgresql://test:test@localhost:5432/testdb
|
|
REDIS_URL: redis://localhost:6379
|
|
|
|
security-scan:
|
|
name: Security scan
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Secret scanning (TruffleHog)
|
|
uses: trufflesecurity/trufflehog@main
|
|
with:
|
|
path: ./
|
|
extra_args: --only-verified
|
|
- name: SAST (Semgrep)
|
|
uses: semgrep/semgrep-action@v1
|
|
with:
|
|
config: >-
|
|
p/javascript
|
|
p/typescript
|
|
p/security-audit
|
|
p/secrets
|
|
continue-on-error: true
|
|
- name: Dep audit (npm audit)
|
|
run: cd bridge && npm audit --audit-level=high
|
|
continue-on-error: false
|
|
|
|
docker-build:
|
|
name: Docker build + healthcheck
|
|
runs-on: ubuntu-latest
|
|
needs: [test-bridge-unit, test-bridge-integration, security-scan]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Build images
|
|
run: docker compose build
|
|
- name: Up stack
|
|
run: |
|
|
cp .env.example .env
|
|
docker compose up -d
|
|
- name: Wait for services
|
|
run: sleep 30
|
|
- name: Healthcheck
|
|
run: ./scripts/healthcheck.sh
|
|
- name: Logs on failure
|
|
if: failure()
|
|
run: docker compose logs
|
|
- name: Cleanup
|
|
if: always()
|
|
run: docker compose down -v
|