92 lines
2.9 KiB
YAML
92 lines
2.9 KiB
YAML
# ─────────────────────────────────────────────────────────────────────────
|
|
# Intégration continue CESIZen — Gitea Actions
|
|
# Déclenchée à chaque push et pull request. Lance les 29 tests automatisés
|
|
# (backend PHPUnit + frontend Vitest + mobile Jest) et le lint.
|
|
# Un déploiement Coolify est déclenché par webhook après un merge sur main
|
|
# (voir docker-compose.prod.yaml + MIGRATION_GITEA.md).
|
|
# ─────────────────────────────────────────────────────────────────────────
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
pull_request:
|
|
branches: [main, develop]
|
|
|
|
jobs:
|
|
# ── Backend Laravel : PHPUnit sur base SQLite en mémoire (cf. backend/phpunit.xml) ──
|
|
backend:
|
|
name: Backend · PHPUnit + Pint
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: backend
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Installer PHP 8.4
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: "8.4"
|
|
extensions: pdo, pdo_sqlite, bcmath, mbstring
|
|
coverage: none
|
|
|
|
- name: Cache des dépendances Composer
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: backend/vendor
|
|
key: composer-${{ hashFiles('backend/composer.lock') }}
|
|
|
|
- name: Installer les dépendances
|
|
run: composer install --no-interaction --prefer-dist --no-progress
|
|
|
|
- name: Vérifier le style (Laravel Pint, PSR-12)
|
|
run: vendor/bin/pint --test
|
|
|
|
- name: Préparer l'environnement (clés)
|
|
run: |
|
|
cp .env.example .env
|
|
php artisan key:generate --force
|
|
php artisan jwt:secret --force
|
|
|
|
- name: Lancer les tests (Unit + Feature)
|
|
run: php artisan test
|
|
|
|
# ── Frontend web Next.js : ESLint + Vitest ──
|
|
frontend:
|
|
name: Frontend · ESLint + Vitest
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: frontend
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: npm
|
|
cache-dependency-path: frontend/package-lock.json
|
|
- run: npm ci
|
|
- name: Lint
|
|
run: npm run lint
|
|
- name: Tests unitaires
|
|
run: npm test
|
|
|
|
# ── Mobile Expo / React Native : Jest ──
|
|
mobile:
|
|
name: Mobile · Jest
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: mobile
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: npm
|
|
cache-dependency-path: mobile/package-lock.json
|
|
- run: npm ci --legacy-peer-deps
|
|
- name: Tests unitaires
|
|
run: npm test
|