915d3ce3a7
- Angular 19 avec routing, SCSS, PWA (Service Worker + manifest) - Couverture de tests ≥ 90% configurée dans karma.conf.js - Docker pour tests isolés (Dockerfile.test + docker-compose.test.yml) - Image de production multi-stage (Dockerfile + nginx.conf) - Hook pre-commit bloquant si tests échouent ou couverture < 90% - CI Gitea (.gitea/workflows/ci.yml) : tests + build/push image Docker - Versioning SemVer depuis 0.0.1 avec scripts npm version:* - Feature flags par environnement (src/environments/) - Documentation fonctionnelle (docs/functional/) et technique (docs/technical/) - CLAUDE.md avec toutes les règles de développement Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
61 lines
1.5 KiB
YAML
61 lines
1.5 KiB
YAML
name: CI — Tests & Docker Build
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'Olhar-PWA/**'
|
|
branches:
|
|
- main
|
|
- 'feat/**'
|
|
pull_request:
|
|
paths:
|
|
- 'Olhar-PWA/**'
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: Olhar-PWA
|
|
|
|
jobs:
|
|
test:
|
|
name: Tests & couverture
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build image de test
|
|
run: docker build -f Dockerfile.test -t olhar-pwa-test:ci .
|
|
|
|
- name: Lancer les tests
|
|
run: docker run --rm --security-opt seccomp=unconfined olhar-pwa-test:ci
|
|
|
|
build-and-push:
|
|
name: Build & push image Docker
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
if: github.ref == 'refs/heads/main'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Lire la version depuis package.json
|
|
id: version
|
|
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
|
|
|
- name: Login registry Gitea
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.goutailler-olivier.com
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build & push image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: Olhar-PWA
|
|
file: Olhar-PWA/Dockerfile
|
|
push: true
|
|
tags: |
|
|
git.goutailler-olivier.com/gato/olhar-pwa:latest
|
|
git.goutailler-olivier.com/gato/olhar-pwa:${{ steps.version.outputs.VERSION }}
|