ci: refonte optimisée — build partagé + artifacts + docker PR-only

This commit is contained in:
Arnaud Dartois authored and Arnaud Dartois committed 2026-08-18 20:06:46 +02:00
1 parent 1fbeff9906
commit 45035d4dfd
2 files changed
+296 -346

No files matched your search

+37 -2
View File
@@ -28,12 +28,37 @@ for f in sorted(logs):
content = fh.read()
except OSError:
continue
# "Passed! - Failed: 0, Passed: 225, Skipped: 0, Total: 225, ... - X.dll (net10.0)"
# Pattern 1: "Passed! - Failed: 0, Passed: 225, Skipped: 0, Total: 225, ... - X.dll (net10.0)"
for m in re.finditer(
r"(Passed!|Failed!)\s+-\s+Failed:\s*(\d+),\s+Passed:\s*(\d+),\s+Skipped:\s*(\d+),\s+Total:\s*(\d+)[^:]*-\s*([\w.]+)\.dll",
content,
):
results.append((m.group(6), m.group(2), m.group(3), m.group(4), m.group(5), m.group(1)))
# Pattern 2: "Passed! - Failed: 0, Passed: 225, Skipped: 0, Total: 225" (without dll name)
if not results:
for m in re.finditer(
r"(Passed!|Failed!)\s+-\s+Failed:\s*(\d+),\s+Passed:\s*(\d+),\s+Skipped:\s*(\d+),\s+Total:\s*(\d+)",
content,
):
# Try to find the DLL name on the same line
line_start = content.rfind("\n", 0, m.start()) + 1
line_end = content.find("\n", m.end())
line = content[line_start:line_end] if line_end > 0 else content[line_start:]
dll_match = re.search(r"-\s*([\w.]+)\.dll", line)
proj = dll_match.group(1) if dll_match else "unknown"
results.append((proj, m.group(2), m.group(3), m.group(4), m.group(5), m.group(1)))
# Pattern 3: look for "Passed!" lines with test counts (alternative format)
for m in re.finditer(
r"Passed!\s*-\s*Failed:\s*(\d+),\s*Passed:\s*(\d+),\s*Skipped:\s*(\d+),\s*Total:\s*(\d+)",
content,
):
# Check if we already have this result
total = m.group(4)
passed = m.group(2)
if not any(r[4] == total and r[2] == passed for r in results):
proj_match = re.search(r"-\s*([\w.]+)\.dll", content[m.end():m.end()+200])
proj = proj_match.group(1) if proj_match else "unknown"
results.append((proj, m.group(1), m.group(2), m.group(3), m.group(4), "Passed!" if m.group(1) == "0" else "Failed!"))
for m in re.finditer(r"error CS\d+:\s*(.+)", content):
error_lines.append(m.group(1).strip()[:120])
@@ -41,6 +66,15 @@ if not results and not error_lines:
print("")
sys.exit(0)
# Deduplicate results by project name
seen = set()
unique_results = []
for r in results:
if r[0] not in seen:
seen.add(r[0])
unique_results.append(r)
results = unique_results
out = []
if results:
out.append("| Projet | Statut | Passed | Failed | Skipped | Total |")
@@ -49,10 +83,11 @@ if results:
icon = "🟢" if status == "Passed!" else "🔴"
out.append(f"| `{proj}` | {icon} | {passed} | {failed} | {skipped} | {total} |")
failed_total = sum(int(r[1]) for r in results)
passed_total = sum(int(r[2]) for r in results)
if failed_total:
out.append(f"\n**⚠️ {failed_total} test(s) en échec** — voir le détail dans le job CI.")
else:
out.append("\n**✅ Tous les tests passent.**")
out.append(f"\n**✅ {passed_total} tests passent.**")
if error_lines:
out.append("\n**Erreurs de compilation détectées :**")
for e in error_lines[:10]: