Refine Woodpecker e2e workflow

This commit is contained in:
openhands 2025-10-12 16:11:17 +00:00
parent c8180a30f3
commit 66cfaed355

View file

@ -1,8 +1,8 @@
kind: pipeline
type: exec
type: docker
name: e2e
node:
labels:
podman: "true"
trigger:
@ -10,40 +10,55 @@ trigger:
- push
- pull_request
environment:
PNPM_HOME: /root/.local/share/pnpm
PATH: /root/.local/share/pnpm:/root/.local/bin:/usr/local/bin:/usr/bin:/bin
steps:
- name: run-e2e
image: mcr.microsoft.com/playwright:v1.56.0-jammy
pull: true
privileged: true
environment:
HARB_ENV: BASE_SEPOLIA_LOCAL_FORK
SKIP_WATCH: "1"
XDG_RUNTIME_DIR: /tmp/podman-run
commands:
- bash -lc '
set -euo pipefail
npm config set fund false
npm config set audit false
npm ci --prefix kraiken-lib --no-audit --no-fund
./scripts/build-kraiken-lib.sh
npm ci --prefix landing --no-audit --no-fund
npm ci --prefix web-app --no-audit --no-fund
npm ci --prefix services/ponder --no-audit --no-fund
npm ci --prefix services/txnBot --no-audit --no-fund
npm ci --no-audit --no-fund
npx playwright install chromium
trap "./scripts/dev.sh stop || true" EXIT
./scripts/dev.sh start
timeout 180 bash -lc "until curl -sf http://localhost:8081/api/graphql > /dev/null; do sleep 3; done"
npm run test:e2e
'
- |
set -euo pipefail
export DEBIAN_FRONTEND=noninteractive
mkdir -p "${XDG_RUNTIME_DIR}"
apt-get update
apt-get install -y podman python3-pip curl jq ca-certificates
python3 -m pip install --no-cache-dir podman-compose
npm config set fund false
npm config set audit false
npm ci --prefix kraiken-lib --no-audit --no-fund
./scripts/build-kraiken-lib.sh
npm ci --prefix landing --no-audit --no-fund
npm ci --prefix web-app --no-audit --no-fund
npm ci --prefix services/ponder --no-audit --no-fund
npm ci --prefix services/txnBot --no-audit --no-fund
npm ci --no-audit --no-fund
npx playwright install chromium
trap "./scripts/dev.sh stop || true" EXIT
./scripts/dev.sh start
timeout 240 bash -c 'until curl -sf http://localhost:8081/api/graphql > /dev/null; do sleep 3; done'
npm run test:e2e
- name: collect-artifacts
image: alpine:3.20
depends_on:
- run-e2e
when:
status:
- success
- failure
commands:
- bash -lc '
set -euo pipefail
mkdir -p artifacts
if [ -d playwright-report ]; then tar -czf artifacts/playwright-report.tgz playwright-report; fi
if [ -d test-results ]; then tar -czf artifacts/test-results.tgz test-results; fi
if [ -d logs ]; then tar -czf artifacts/stack-logs.tgz logs; fi
'
- |
set -euo pipefail
apk add --no-cache tar gzip
mkdir -p artifacts
if [ -d playwright-report ]; then tar -czf artifacts/playwright-report.tgz playwright-report; fi
if [ -d test-results ]; then tar -czf artifacts/test-results.tgz test-results; fi
if [ -d logs ]; then tar -czf artifacts/stack-logs.tgz logs; fi