CI / quality (push) Waiting to run
CI / e2e-and-a11y (push) Blocked by required conditions
CI / lighthouse (push) Blocked by required conditions
CI / android-smoke (push) Waiting to run
CI / pull-request-report (push) Blocked by required conditions
Security / codeql (push) Waiting to run
Security / deps-and-secrets (push) Waiting to run
159 lines
4.9 KiB
YAML
159 lines
4.9 KiB
YAML
name: CI
|
||
|
||
on:
|
||
pull_request:
|
||
push:
|
||
branches: [main]
|
||
|
||
jobs:
|
||
quality:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@v7
|
||
- uses: actions/setup-node@v7
|
||
with:
|
||
node-version: 22
|
||
cache: npm
|
||
- run: npm ci
|
||
- run: npm run pipeline:recipes
|
||
- run: npm run check:quality
|
||
- run: npm run lint
|
||
- run: npm run typecheck
|
||
- run: npm run test:coverage
|
||
- name: Upload coverage
|
||
uses: actions/upload-artifact@v7
|
||
with:
|
||
name: coverage-summary
|
||
path: |
|
||
coverage/coverage-summary.json
|
||
coverage/lcov.info
|
||
|
||
e2e-and-a11y:
|
||
runs-on: ubuntu-latest
|
||
needs: quality
|
||
steps:
|
||
- uses: actions/checkout@v7
|
||
- uses: actions/setup-node@v7
|
||
with:
|
||
node-version: 22
|
||
cache: npm
|
||
- run: npm ci
|
||
- run: npm run pipeline:recipes
|
||
- run: npx playwright install --with-deps
|
||
- run: npm run test:e2e
|
||
- name: Upload quality summaries (a11y + perf)
|
||
uses: actions/upload-artifact@v7
|
||
with:
|
||
name: quality-e2e
|
||
path: quality-out/
|
||
if-no-files-found: warn
|
||
|
||
lighthouse:
|
||
runs-on: ubuntu-latest
|
||
needs: quality
|
||
steps:
|
||
- uses: actions/checkout@v7
|
||
- uses: actions/setup-node@v7
|
||
with:
|
||
node-version: 22
|
||
cache: npm
|
||
- run: npm ci
|
||
- run: npm run audit:lighthouse
|
||
# .lighthouseci est dans .gitignore : upload-artifact exclut ces fichiers → aucun artefact « lighthouse-ci ».
|
||
# Copie vers un dossier non ignoré pour forcer l’upload réel des LHR.
|
||
- name: Stage LHCI reports for artifact
|
||
run: |
|
||
rm -rf __lhci_artifact__
|
||
mkdir -p __lhci_artifact__
|
||
cp -R .lighthouseci/. __lhci_artifact__/
|
||
test "$(find __lhci_artifact__ -type f | wc -l)" -gt 0 || { echo "::error::LHCI n'a produit aucun fichier"; exit 1; }
|
||
- name: Upload Lighthouse CI output
|
||
uses: actions/upload-artifact@v7
|
||
with:
|
||
name: lighthouse-ci
|
||
path: __lhci_artifact__
|
||
if-no-files-found: error
|
||
|
||
android-smoke:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@v7
|
||
- uses: actions/setup-node@v7
|
||
with:
|
||
node-version: 22
|
||
cache: npm
|
||
- uses: actions/setup-java@v5
|
||
with:
|
||
distribution: temurin
|
||
java-version: 21
|
||
- name: Setup Android SDK
|
||
uses: android-actions/setup-android@v4
|
||
- run: sdkmanager "platforms;android-35" "build-tools;35.0.0"
|
||
- run: npm ci
|
||
- run: npm run pipeline:recipes
|
||
- run: npm run build:web
|
||
- run: npm run mobile:sync
|
||
- name: Gradle assembleDebug
|
||
working-directory: apps/mobile/android
|
||
run: chmod +x gradlew && ./gradlew assembleDebug --no-daemon
|
||
|
||
pull-request-report:
|
||
if: github.event_name == 'pull_request'
|
||
needs: [quality, e2e-and-a11y, lighthouse]
|
||
runs-on: ubuntu-latest
|
||
permissions:
|
||
contents: read
|
||
pull-requests: write
|
||
steps:
|
||
- uses: actions/checkout@v7
|
||
- uses: actions/setup-node@v7
|
||
with:
|
||
node-version: 22
|
||
cache: npm
|
||
- run: npm ci
|
||
- run: mkdir -p incoming
|
||
- run: npm audit --json > incoming/audit.json || true
|
||
# Même version majeure que upload-artifact (@v7) : v8 peut ne pas résoudre les artefacts v7.
|
||
- uses: actions/download-artifact@v8
|
||
with:
|
||
name: coverage-summary
|
||
path: incoming/coverage
|
||
- uses: actions/download-artifact@v8
|
||
with:
|
||
name: quality-e2e
|
||
path: incoming/e2e
|
||
- uses: actions/download-artifact@v8
|
||
with:
|
||
name: lighthouse-ci
|
||
path: incoming/lhci
|
||
- run: node scripts/ci/pr-quality-report.mjs incoming incoming/pr-body.md
|
||
- uses: actions/github-script@v9
|
||
with:
|
||
script: |
|
||
const fs = require('fs');
|
||
const marker = '<!-- ben-to-quality-report -->';
|
||
const body = marker + '\n' + fs.readFileSync('incoming/pr-body.md','utf8');
|
||
const issue_number = context.payload.pull_request.number;
|
||
const { data: comments } = await github.rest.issues.listComments({
|
||
owner: context.repo.owner,
|
||
repo: context.repo.repo,
|
||
issue_number,
|
||
per_page: 100
|
||
});
|
||
const existing = comments.find(c => c.body.includes(marker));
|
||
if (existing) {
|
||
await github.rest.issues.updateComment({
|
||
owner: context.repo.owner,
|
||
repo: context.repo.repo,
|
||
comment_id: existing.id,
|
||
body
|
||
});
|
||
} else {
|
||
await github.rest.issues.createComment({
|
||
owner: context.repo.owner,
|
||
repo: context.repo.repo,
|
||
issue_number,
|
||
body
|
||
});
|
||
}
|