From 3e89693b085420fd17c8a6ff474a0dc9000edbb4 Mon Sep 17 00:00:00 2001 From: mirage <119869686+ClementBobin@users.noreply.github.com> Date: Fri, 27 Mar 2026 10:33:05 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20am=C3=A9liorer=20le=20format=20du=20rap?= =?UTF-8?q?port=20de=20performance=20en=20convertissant=20le=20contenu=20A?= =?UTF-8?q?NSI=20en=20Markdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/pr-endpoint-check.yml | 33 +++++++++++++++++++------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/pr-endpoint-check.yml b/.gitea/workflows/pr-endpoint-check.yml index f730a22..e343c7f 100644 --- a/.gitea/workflows/pr-endpoint-check.yml +++ b/.gitea/workflows/pr-endpoint-check.yml @@ -66,20 +66,37 @@ jobs: REPO: ${{ gitea.repository }} PR_NUMBER: ${{ gitea.event.pull_request.number }} run: | - REPORT_CONTENT=$(cat /tmp/webzine_endpoint_output.txt) + # Lire le rapport original + RAW_REPORT=$(cat /tmp/webzine_endpoint_output.txt) FAILED_COUNT="${{ steps.perf_test.outputs.failed }}" - # Échapper le contenu pour JSON - REPORT_CONTENT_ESCAPED=$(echo "$REPORT_CONTENT" | sed 's/`/\\`/g' | sed 's/\\/\\\\/g') + # Convertir le rapport ANSI en Markdown avec couleurs + # Supprimer d'abord les codes ANSI pour le traitement + CLEAN_REPORT=$(echo "$RAW_REPORT" | sed 's/\x1b\[[0-9;]*m//g') + + # Générer le rapport formaté en Markdown avec couleurs + FORMATTED_REPORT=$(echo "$CLEAN_REPORT" | sed \ + -e 's/^\[OK\] /✅ /' \ + -e 's/^\[LENT\] /⚠️ /' \ + -e 's/^\[ÉCHEC\] /❌ /' \ + -e 's/^── \(.*\)$/\n### ── \1/' \ + -e 's/^→/ •/' \ + -e 's/^\(Total.*\)$/\n**\1**/' \ + -e 's/^\(Réussis.*\)$/**✅ \1**/' \ + -e 's/^\(Échecs.*\)$/**❌ \1**/' \ + -e 's/^\(❌ ENDPOINTS EN ÉCHEC.*\)$/\n### \1/' \ + -e 's/^\(La PR doit.*\)$/\n**❌ \1**/' \ + -e 's/^╔\(.*\)╗$/```\n╔\1╗/' \ + -e 's/^╚\(.*\)╝$/╚\1╝\n```/') if [ "${FAILED_COUNT:-0}" -gt 0 ]; then HEADER="## ❌ Vérification des performances ÉCHOUÉE" INTRO="${FAILED_COUNT} endpoint(s) ont dépassé 1 seconde ou retourné une erreur serveur." - STATUS="ÉCHEC" + STATUS="❌ ÉCHEC" else HEADER="## ✅ Vérification des performances RÉUSSIE" INTRO="Tous les endpoints ont répondu en moins d'une seconde." - STATUS="SUCCÈS" + STATUS="✅ SUCCÈS" fi BODY=$(cat <