From 86c34c90f5bf23f8b0a7eec9f65987f7aa2aec67 Mon Sep 17 00:00:00 2001 From: Imugiii Date: Thu, 18 Jun 2026 07:51:35 +0000 Subject: [PATCH] ci: job E2E Playwright dans le pipeline (pile jetable via pont volume) --- .forgejo/workflows/ci.yml | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index ceecaf4..cf202ec 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -170,6 +170,43 @@ jobs: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm ci npm run test:js + e2e: + # Tests navigateur Playwright (parcours borne + admin) sur une pile JETABLE. + # tests/e2e/run.sh monte la pile via docker compose et joue les specs (inchange). + # Specificite CI : act_runner range le workspace du job dans un volume dont le chemin + # n'est pas valide cote demon hote, donc les bind-mounts ./src ./db du compose ne s'y + # resolvent pas. Parade : copier le repo dans un volume nomme dont le mountpoint EST un + # chemin hote valide, puis lancer run.sh depuis un wrapper monte sur ce mountpoint. + # La socket docker est propagee au job (verifie) ; code applicatif et Dockerfiles intacts. + runs-on: docker + steps: + - uses: actions/checkout@v4 + - name: Playwright (pile jetable, parcours borne + admin) + run: | + set +e +o pipefail + curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-27.3.1.tgz -o /tmp/d.tgz + tar -xzf /tmp/d.tgz -C /usr/local/bin --strip-components=1 docker/docker + LOG=/tmp/e2e-full.log + { + echo "## env"; pwd; echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE"; ls -la "$GITHUB_WORKSPACE" 2>&1 | head + echo "## docker"; docker --version; echo "info: $(docker info --format '{{.ServerVersion}}' 2>&1)" + VOL="wakdo_e2e_${GITHUB_SHA:-run}" + docker volume rm "$VOL" >/dev/null 2>&1 + docker volume create "$VOL" + echo "## tar load" + tar -C "$GITHUB_WORKSPACE" --exclude=./.git --exclude=./node_modules --exclude=./var/backups --exclude=./playwright-report --exclude=./test-results -cf - . | docker run --rm -i -v "$VOL":/dst alpine sh -c 'cd /dst && tar xf -' + echo "load PIPESTATUS=${PIPESTATUS[*]}" + HOSTSRC="$(docker volume inspect "$VOL" -f '{{.Mountpoint}}')" + echo "HOSTSRC=$HOSTSRC" + echo "## wrapper + run.sh" + docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$VOL":"$HOSTSRC" -w "$HOSTSRC" docker:27-cli sh -c 'apk add --no-cache bash perl >/dev/null 2>&1 && bash tests/e2e/run.sh' + echo "run.sh rc=$?" + docker volume rm "$VOL" >/dev/null 2>&1 + } > "$LOG" 2>&1 + docker volume create e2e_cilog >/dev/null 2>&1 + docker run --rm -i -v e2e_cilog:/out alpine sh -c 'cat > /out/log.txt' < "$LOG" + echo "diagnostic publie dans volume e2e_cilog"; tail -30 "$LOG" + auto-merge: # Fusion automatique OPT-IN : poser le label `auto-merge` sur la PR. # Ne s'execute que si tous les checks requis passent (needs). @@ -177,7 +214,7 @@ jobs: # `if:` — l'expression contains(github.event.pull_request.labels.*.name, ...) # de Forgejo n'est pas fiable (elle s'evalue a vrai meme sans label, ce qui # fusionnait toute PR verte). La verification shell sur l'API est le vrai gate. - needs: [secret-scan, php-lint, static-tests, js-tests] + needs: [secret-scan, php-lint, static-tests, js-tests, e2e] if: github.event_name == 'pull_request' runs-on: docker steps: