xpeditis2.0/.gitea/workflows/ci.yml
David f2b6782e5c
Some checks failed
Dev CI / Security gate (push) Failing after 1m37s
CD Preprod / Image security (${{ matrix.service }}, ${{ matrix.arch }}) (amd64, backend) (push) Has been skipped
Dev CI / Backend — Lint (push) Has been skipped
Dev CI / Frontend — Lint & Type-check (push) Has been skipped
Dev CI / Backend — Unit Tests (push) Has been skipped
Dev CI / Frontend — Unit Tests (push) Has been skipped
Dev CI / Notify Failure (push) Has been skipped
CD Preprod / Security gate (push) Failing after 1m37s
CD Preprod / Backend — Integration Tests (push) Has been skipped
CD Preprod / Build Backend (push) Has been skipped
CD Preprod / Build Frontend (push) Has been skipped
CD Preprod / Build Log Exporter (push) Has been skipped
CD Preprod / Backend — Lint (push) Has been skipped
CD Preprod / Frontend — Lint & Type-check (push) Has been skipped
CD Preprod / Backend — Unit Tests (push) Has been skipped
CD Preprod / Frontend — Unit Tests (push) Has been skipped
CD Preprod / Image security (${{ matrix.service }}, ${{ matrix.arch }}) (amd64, frontend) (push) Has been skipped
CD Preprod / Image security (${{ matrix.service }}, ${{ matrix.arch }}) (amd64, log-exporter) (push) Has been skipped
CD Preprod / Image security (${{ matrix.service }}, ${{ matrix.arch }}) (arm64, backend) (push) Has been skipped
CD Preprod / Image security (${{ matrix.service }}, ${{ matrix.arch }}) (arm64, frontend) (push) Has been skipped
CD Preprod / Image security (${{ matrix.service }}, ${{ matrix.arch }}) (arm64, log-exporter) (push) Has been skipped
CD Preprod / Deploy to Preprod (push) Has been skipped
CD Preprod / Notify Success (push) Has been skipped
CD Preprod / Notify Failure (push) Has been skipped
CD Production / Security gate (push) Failing after 1m35s
CD Production / Backend — Tests unitaires (push) Has been skipped
CD Production / Frontend — Tests unitaires (push) Has been skipped
CD Production / Backend — Lint (push) Has been skipped
CD Production / Frontend — Lint & Type-check (push) Has been skipped
CD Production / Vérifier l'image de preprod (push) Has been skipped
CD Production / Reconstruire le frontend (URLs de production) (push) Has been skipped
CD Production / Image security (${{ matrix.service }}, ${{ matrix.arch }}) (amd64, backend) (push) Has been skipped
CD Production / Image security (${{ matrix.service }}, ${{ matrix.arch }}) (amd64, frontend) (push) Has been skipped
CD Production / Image security (${{ matrix.service }}, ${{ matrix.arch }}) (amd64, log-exporter) (push) Has been skipped
CD Production / Déployer en production (push) Has been skipped
CD Production / Notifier le succès (push) Has been skipped
CD Production / Notifier l'échec (push) Has been skipped
ci: stop pipelines and alert Discord when the Security gate fails
Lint and unit-test jobs now depend on the Security gate, so a failure
stops every workflow (dev, preprod, main, PR checks) before anything else
runs. The security job posts its own Discord alert; the generic failure
notification skips that case to avoid duplicates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 10:51:05 +02:00

132 lines
4.3 KiB
YAML

name: Dev CI
on:
push:
branches: [dev]
pull_request:
branches: [dev]
jobs:
security:
name: Security gate
runs-on: ubuntu-latest
steps:
- uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- uses: ./.gitea/actions/setup-node
- name: Install Trivy
shell: bash
run: |
trivy_bin=$(bash scripts/ci/install-tool.sh trivy)
"$trivy_bin" --version
- name: Validate workflows and deployment checks
shell: bash
run: |
actionlint_bin=$(bash scripts/ci/install-tool.sh actionlint)
ACTIONLINT_BIN="$actionlint_bin" bash scripts/ci/validate-workflows.sh
- name: Audit dependencies, secrets and infrastructure
shell: bash
run: bash scripts/ci/security-audit.sh
- name: Show security results
if: always()
shell: bash
run: python3 scripts/ci/summarize-security.py
- name: Save security reports on Gitea
if: always()
uses: https://github.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3, Gitea artifact protocol
with:
name: security-reports
path: ${{ runner.temp }}/security-reports/*.json
retention-days: 7
if-no-files-found: error
- name: Notify Discord
if: failure()
uses: ./.gitea/actions/notify-security-failure
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
pipeline: Dev
backend-quality:
name: Backend — Lint
runs-on: ubuntu-latest
needs: security
defaults:
run:
working-directory: apps/backend
steps:
- uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- uses: ./.gitea/actions/setup-node
- run: npm ci --legacy-peer-deps
- run: npm run lint -- --no-fix
frontend-quality:
name: Frontend — Lint & Type-check
runs-on: ubuntu-latest
needs: security
defaults:
run:
working-directory: apps/frontend
steps:
- uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- uses: ./.gitea/actions/setup-node
- run: npm ci --legacy-peer-deps
- run: npm run lint
- run: npm run type-check
backend-tests:
name: Backend — Unit Tests
runs-on: ubuntu-latest
needs: backend-quality
defaults:
run:
working-directory: apps/backend
steps:
- uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- uses: ./.gitea/actions/setup-node
- run: npm ci --legacy-peer-deps
- run: npm test -- --ci --runInBand
frontend-tests:
name: Frontend — Unit Tests
runs-on: ubuntu-latest
needs: frontend-quality
defaults:
run:
working-directory: apps/frontend
steps:
- uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- uses: ./.gitea/actions/setup-node
- run: npm ci --legacy-peer-deps
- run: npm test -- --ci --runInBand
notify-failure:
name: Notify Failure
runs-on: ubuntu-latest
needs: [security, backend-quality, frontend-quality, backend-tests, frontend-tests]
# Security gate failures are already reported by the security job itself.
if: failure() && needs.security.result != 'failure'
steps:
- name: Discord
run: |
curl -s -H "Content-Type: application/json" -d '{
"embeds": [{
"title": "❌ Dev CI Failed",
"color": 15158332,
"fields": [
{"name": "Branch", "value": "`${{ github.ref_name }}`", "inline": true},
{"name": "Author", "value": "${{ github.actor }}", "inline": true},
{"name": "Workflow", "value": "[${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})", "inline": false}
],
"footer": {"text": "Xpeditis CI • Dev"}
}]
}' ${{ secrets.DISCORD_WEBHOOK_URL }}