From f5ddbb49fef55d82a39409cf5d20d9d6058a51e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= Date: Wed, 8 Jul 2026 16:22:41 +0200 Subject: [PATCH] ci: publish agent-regression results to slack, run nightly Mirror the wpt/e2e-integration pattern: tee the suite output to a log, strip the ANSI colors, and upload it to the #ci-agent channel (AGENT_SLACK_CHANNEL_ID) via the CI slack bot, with the final pass/fail summary as the comment. The post also happens when the suite fails, without masking its exit code (explicit bash pipefail). Add a nightly cron trigger (03:37, offset from wpt's 02:21) so the suite actually runs unattended; workflow_dispatch stays for manual runs with a model override. --- .github/workflows/agent-regression.yml | 31 +++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/agent-regression.yml b/.github/workflows/agent-regression.yml index 00f4416a5..0b06b9b8e 100644 --- a/.github/workflows/agent-regression.yml +++ b/.github/workflows/agent-regression.yml @@ -1,6 +1,10 @@ name: agent-regression on: + schedule: + # Offset from wpt's 02:21 nightly. + - cron: "37 3 * * *" + workflow_dispatch: inputs: model: @@ -57,6 +61,8 @@ jobs: - run: chmod a+x bin/lightpanda - name: run agent regression suite (deterministic + live) + # Explicit bash gets pipefail, so tee doesn't mask the suite's exit code. + shell: bash env: LPD_PATH: ${{ github.workspace }}/bin/lightpanda GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} @@ -64,4 +70,27 @@ jobs: # Optional: news.ycombinator.com often blocks datacenter IPs. Reuse # the residential proxy secret if present; empty is fine locally. LP_HTTP_PROXY: ${{ secrets.MASSIVE_PROXY_RESIDENTIAL_US }} - run: ./agent/run.sh all + run: ./agent/run.sh all 2>&1 | tee result.log + + # run.sh colors its output unconditionally; strip the ANSI codes for + # Slack (the Actions log above keeps them). + - name: prepare slack log + id: log + if: ${{ !cancelled() }} + run: | + sed 's/\x1b\[[0-9;]*m//g' result.log > slack.log 2>/dev/null \ + || echo "suite produced no output (earlier step failed)" > slack.log + echo "summary=$(grep -o 'SUMMARY: .*' slack.log | tail -1)" >> "$GITHUB_OUTPUT" + + - name: Send result to slack + if: ${{ !cancelled() }} + uses: slackapi/slack-github-action@v3.0.1 + with: + errors: true + method: files.uploadV2 + token: ${{ secrets.CI_SLACK_BOT_TOKEN }} + payload: | + channel_id: ${{ vars.AGENT_SLACK_CHANNEL_ID }} + initial_comment: "Agent regression — ${{ steps.log.outputs.summary || 'no summary (suite crashed?)' }}" + file: "./slack.log" + filename: "agent-regression-${{ github.sha }}.txt"