name: E2E Recent Tests permissions: contents: read on: push: branches: [main] paths-ignore: - '**.md' - 'docs/**' - 'LICENSE' - '.gitignore' - 'skill/**' - 'plugin/**' pull_request: branches: [main] paths-ignore: - '**.md' - 'docs/**' - 'LICENSE' - '.gitignore' - 'skill/**' - 'plugin/**' workflow_dispatch: env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true jobs: recent: name: E2E Recent Tests runs-on: ubuntu-latest if: github.event_name != 'pull_request' || github.event.pull_request.draft == false timeout-minutes: 10 steps: - name: Checkout uses: actions/checkout@v5 - name: Set up Go uses: actions/setup-go@v6 with: go-version-file: go.mod cache: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Run recent E2E tests id: e2e run: | set +e mkdir -p tests/e2e/results ./dev e2e recent 2>&1 | tee e2e-output.log EXIT_CODE=${PIPESTATUS[0]} PASSED=$(grep -oP 'Passed:\s*\K\d+' e2e-output.log | tail -1 || true) FAILED=$(grep -oP 'Failed:\s*\K\d+' e2e-output.log | tail -1 || true) FAILURES=$(grep -E '✗.*failed' e2e-output.log | sed 's/.*✗ /- /' | head -10 || true) PASSED=${PASSED:-0} FAILED=${FAILED:-0} echo "passed=$PASSED" >> $GITHUB_OUTPUT echo "failed=$FAILED" >> $GITHUB_OUTPUT { echo 'failures<> $GITHUB_OUTPUT exit $EXIT_CODE env: DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 - name: Dump pinchtab logs on failure if: failure() run: | echo "==== pinchtab logs ====" docker compose -f tests/e2e/docker-compose.yml logs pinchtab || true echo "" echo "==== filtered Chrome/extension lines ====" docker compose -f tests/e2e/docker-compose.yml logs pinchtab 2>/dev/null | grep -Ei 'chrome|extension|devtools|load-extension|disable-extensions|headless|warning|error' || true echo "" echo "==== instance inventory ====" INSTANCES_JSON=$(curl -sf http://localhost:9999/instances || true) if [ -n "$INSTANCES_JSON" ]; then echo "$INSTANCES_JSON" if command -v jq >/dev/null 2>&1; then echo "$INSTANCES_JSON" | jq -r '.[].id' | while read -r inst_id; do [ -z "$inst_id" ] && continue echo "" echo "==== logs for $inst_id ====" curl -sf "http://localhost:9999/instances/$inst_id/logs" || true done fi else echo "unable to fetch /instances from localhost:9999" fi - name: Post summary if: always() run: | PASSED="${{ steps.e2e.outputs.passed }}" FAILED="${{ steps.e2e.outputs.failed }}" PASSED="${PASSED:-0}" FAILED="${FAILED:-0}" if [ "${{ steps.e2e.outcome }}" = "success" ]; then echo "## ✅ E2E Recent Tests Passed" >> $GITHUB_STEP_SUMMARY if [ "$PASSED" = "0" ]; then echo "All tests passed" >> $GITHUB_STEP_SUMMARY else echo "**$PASSED** tests passed" >> $GITHUB_STEP_SUMMARY fi else echo "## ❌ E2E Recent Tests Failed" >> $GITHUB_STEP_SUMMARY echo "**Passed:** $PASSED" >> $GITHUB_STEP_SUMMARY echo "**Failed:** $FAILED" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY echo "${{ steps.e2e.outputs.failures }}" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY fi - name: Report check annotation if: always() run: | PASSED="${{ steps.e2e.outputs.passed }}" FAILED="${{ steps.e2e.outputs.failed }}" PASSED="${PASSED:-0}" FAILED="${FAILED:-0}" if [ "${{ steps.e2e.outcome }}" = "success" ]; then if [ "$PASSED" = "0" ]; then echo "::notice title=E2E Recent Tests::✅ All tests passed" else echo "::notice title=E2E Recent Tests::✅ ${PASSED} tests passed" fi else echo "::error title=E2E Recent Tests::❌ ${FAILED} failed, ${PASSED} passed" fi e2e-curl: name: E2E Curl Tests needs: recent runs-on: ubuntu-latest timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@v5 - name: Set up Go uses: actions/setup-go@v6 with: go-version-file: go.mod cache: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Run E2E curl tests id: e2e run: | set +e mkdir -p tests/e2e/results ./dev e2e curl 2>&1 | tee e2e-output.log EXIT_CODE=${PIPESTATUS[0]} PASSED=$(grep -oP 'Passed:\s*\K\d+' e2e-output.log | tail -1 || true) FAILED=$(grep -oP 'Failed:\s*\K\d+' e2e-output.log | tail -1 || true) FAILURES=$(grep -E '✗.*failed' e2e-output.log | sed 's/.*✗ /- /' | head -10 || true) PASSED=${PASSED:-0} FAILED=${FAILED:-0} echo "passed=$PASSED" >> $GITHUB_OUTPUT echo "failed=$FAILED" >> $GITHUB_OUTPUT { echo 'failures<> $GITHUB_OUTPUT exit $EXIT_CODE env: DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 - name: Post summary if: always() run: | PASSED="${{ steps.e2e.outputs.passed }}" FAILED="${{ steps.e2e.outputs.failed }}" PASSED="${PASSED:-0}" FAILED="${FAILED:-0}" if [ "${{ steps.e2e.outcome }}" = "success" ]; then echo "## ✅ E2E Curl Tests Passed" >> $GITHUB_STEP_SUMMARY if [ "$PASSED" = "0" ]; then echo "All tests passed" >> $GITHUB_STEP_SUMMARY else echo "**$PASSED** tests passed" >> $GITHUB_STEP_SUMMARY fi else echo "## ❌ E2E Curl Tests Failed" >> $GITHUB_STEP_SUMMARY echo "**Passed:** $PASSED" >> $GITHUB_STEP_SUMMARY echo "**Failed:** $FAILED" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY echo "${{ steps.e2e.outputs.failures }}" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY fi - name: Report check annotation if: always() run: | PASSED="${{ steps.e2e.outputs.passed }}" FAILED="${{ steps.e2e.outputs.failed }}" PASSED="${PASSED:-0}" FAILED="${FAILED:-0}" if [ "${{ steps.e2e.outcome }}" = "success" ]; then if [ "$PASSED" = "0" ]; then echo "::notice title=E2E Curl Tests::✅ All tests passed" else echo "::notice title=E2E Curl Tests::✅ ${PASSED} tests passed" fi else echo "::error title=E2E Curl Tests::❌ ${FAILED} failed, ${PASSED} passed" fi e2e-cli: name: E2E CLI Tests needs: recent runs-on: ubuntu-latest timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@v5 - name: Set up Go uses: actions/setup-go@v6 with: go-version-file: go.mod cache: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Run CLI E2E tests id: e2e run: | set +e ./dev e2e cli 2>&1 | tee e2e-output.log EXIT_CODE=${PIPESTATUS[0]} PASSED=$(grep -oP 'Passed:\s*\K\d+' e2e-output.log | tail -1 || true) FAILED=$(grep -oP 'Failed:\s*\K\d+' e2e-output.log | tail -1 || true) FAILURES=$(grep -E '✗.*failed' e2e-output.log | sed 's/.*✗ /- /' | head -10 || true) PASSED=${PASSED:-0} FAILED=${FAILED:-0} echo "passed=$PASSED" >> $GITHUB_OUTPUT echo "failed=$FAILED" >> $GITHUB_OUTPUT { echo 'failures<> $GITHUB_OUTPUT exit $EXIT_CODE env: DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 - name: Post summary if: always() run: | PASSED="${{ steps.e2e.outputs.passed }}" FAILED="${{ steps.e2e.outputs.failed }}" PASSED="${PASSED:-0}" FAILED="${FAILED:-0}" if [ "${{ steps.e2e.outcome }}" = "success" ]; then echo "## ✅ E2E CLI Tests Passed" >> $GITHUB_STEP_SUMMARY if [ "$PASSED" = "0" ]; then echo "All tests passed" >> $GITHUB_STEP_SUMMARY else echo "**$PASSED** tests passed" >> $GITHUB_STEP_SUMMARY fi else echo "## ❌ E2E CLI Tests Failed" >> $GITHUB_STEP_SUMMARY echo "**Passed:** $PASSED" >> $GITHUB_STEP_SUMMARY echo "**Failed:** $FAILED" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY echo "${{ steps.e2e.outputs.failures }}" >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY fi - name: Report check annotation if: always() run: | PASSED="${{ steps.e2e.outputs.passed }}" FAILED="${{ steps.e2e.outputs.failed }}" PASSED="${PASSED:-0}" FAILED="${FAILED:-0}" if [ "${{ steps.e2e.outcome }}" = "success" ]; then if [ "$PASSED" = "0" ]; then echo "::notice title=E2E CLI Tests::✅ All tests passed" else echo "::notice title=E2E CLI Tests::✅ ${PASSED} tests passed" fi else echo "::error title=E2E CLI Tests::❌ ${FAILED} failed, ${PASSED} passed" fi