mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 09:41:04 +01:00
147 lines
5.3 KiB
YAML
147 lines
5.3 KiB
YAML
name: E2E Tests
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
skip_llm:
|
|
description: "Unused for PAP-11985 Hermes gateway smoke"
|
|
type: boolean
|
|
default: true
|
|
|
|
jobs:
|
|
e2e:
|
|
name: Hermes Gateway Docker Smoke
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 45
|
|
env:
|
|
PAPERCLIP_HOME: /tmp/paperclip-home-${{ github.run_id }}-${{ github.run_attempt }}
|
|
PAPERCLIP_INSTANCE_ID: hermes-gateway-smoke
|
|
PAPERCLIP_MIGRATION_AUTO_APPLY: "true"
|
|
PAPERCLIP_MIGRATION_PROMPT: "never"
|
|
PAPERCLIP_DEPLOYMENT_MODE: local_trusted
|
|
SERVE_UI: "false"
|
|
HOST: 127.0.0.1
|
|
PORT: "3100"
|
|
PAPERCLIP_API_URL: http://127.0.0.1:3100
|
|
PAPERCLIP_AUTH_HEADER: Bearer local-trusted-hermes-smoke
|
|
OPENROUTER_API_KEY: ${{ secrets.PAP11985_OPENROUTER_API_KEY }}
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
|
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
|
HERMES_SMOKE_RUN_SUFFIX: gh-${{ github.run_id }}-${{ github.run_attempt }}
|
|
HERMES_CONTAINER_NAME: paperclip-hermes-gateway-smoke-gh-${{ github.run_id }}-${{ github.run_attempt }}
|
|
HERMES_SMOKE_NETWORK: host
|
|
HERMES_DOCKER_ADD_HOST: "0"
|
|
HERMES_GATEWAY_API_BASE_URL: http://127.0.0.1:8642
|
|
HERMES_GATEWAY_PROBE_URL: http://127.0.0.1:8642
|
|
PAPERCLIP_API_URL_FOR_HERMES: http://127.0.0.1:3100
|
|
HERMES_SMOKE_DIAG_DIR: /tmp/hermes-gateway-diag-${{ github.run_id }}-${{ github.run_attempt }}
|
|
HERMES_SMOKE_STATE_DIR: /tmp/hermes-gateway-state-${{ github.run_id }}-${{ github.run_attempt }}
|
|
HERMES_SMOKE_MODEL_PROVIDER: openrouter
|
|
HERMES_SMOKE_MODEL_DEFAULT: z-ai/glm-5.2
|
|
HERMES_SMOKE_MODEL_BASE_URL: https://openrouter.ai/api/v1
|
|
RUN_TIMEOUT_SEC: "420"
|
|
CASE_TIMEOUT_SEC: "420"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: pnpm/action-setup@v6
|
|
with:
|
|
version: 9.15.4
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --no-frozen-lockfile
|
|
|
|
- name: Build runtime package dependencies
|
|
run: pnpm --filter @paperclipai/plugin-sdk build
|
|
|
|
- name: Record Docker runner details
|
|
run: |
|
|
set -euo pipefail
|
|
docker version
|
|
docker info
|
|
|
|
- name: Start ephemeral Paperclip
|
|
run: |
|
|
set -euo pipefail
|
|
nohup pnpm --filter @paperclipai/server dev >"$RUNNER_TEMP/paperclip-server.log" 2>&1 &
|
|
echo "$!" >"$RUNNER_TEMP/paperclip-server.pid"
|
|
for _ in $(seq 1 180); do
|
|
if curl -fsS "$PAPERCLIP_API_URL/api/health" >"$RUNNER_TEMP/paperclip-health.json"; then
|
|
cat "$RUNNER_TEMP/paperclip-health.json"
|
|
exit 0
|
|
fi
|
|
if ! kill -0 "$(cat "$RUNNER_TEMP/paperclip-server.pid")" 2>/dev/null; then
|
|
cat "$RUNNER_TEMP/paperclip-server.log"
|
|
exit 1
|
|
fi
|
|
sleep 1
|
|
done
|
|
cat "$RUNNER_TEMP/paperclip-server.log"
|
|
exit 1
|
|
|
|
- name: Create smoke company
|
|
run: |
|
|
set -euo pipefail
|
|
curl -fsS \
|
|
-X POST \
|
|
-H "Authorization: $PAPERCLIP_AUTH_HEADER" \
|
|
-H "Content-Type: application/json" \
|
|
--data '{"name":"Hermes Gateway Smoke","description":"PAP-11985 GitHub Docker runner smoke"}' \
|
|
"$PAPERCLIP_API_URL/api/companies" \
|
|
| tee "$RUNNER_TEMP/paperclip-company.json"
|
|
jq '{id,name,issuePrefix,status}' "$RUNNER_TEMP/paperclip-company.json"
|
|
|
|
- name: Run Hermes gateway Docker E2E smoke
|
|
run: |
|
|
set -euo pipefail
|
|
pnpm smoke:hermes-gateway-e2e 2>&1 | tee "$RUNNER_TEMP/hermes-gateway-e2e.log"
|
|
|
|
- name: Summarize smoke
|
|
if: always()
|
|
run: |
|
|
{
|
|
echo "### Hermes Gateway Docker Smoke"
|
|
echo
|
|
echo "- Runner: GitHub Actions ubuntu-latest"
|
|
echo "- Network mode: Docker host network"
|
|
echo "- Paperclip API: $PAPERCLIP_API_URL"
|
|
echo "- Hermes gateway API/probe: $HERMES_GATEWAY_API_BASE_URL / $HERMES_GATEWAY_PROBE_URL"
|
|
echo
|
|
if [[ -f "$HERMES_SMOKE_DIAG_DIR/summary.env" ]]; then
|
|
echo '```'
|
|
sed -E 's/(sha256=)[a-f0-9]+/\1<redacted>/g' "$HERMES_SMOKE_DIAG_DIR/summary.env"
|
|
echo '```'
|
|
fi
|
|
} >>"$GITHUB_STEP_SUMMARY"
|
|
|
|
- name: Upload smoke diagnostics
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: hermes-gateway-smoke-${{ github.run_id }}-${{ github.run_attempt }}
|
|
path: |
|
|
${{ runner.temp }}/paperclip-server.log
|
|
${{ runner.temp }}/paperclip-health.json
|
|
${{ runner.temp }}/paperclip-company.json
|
|
${{ runner.temp }}/hermes-gateway-e2e.log
|
|
${{ env.HERMES_SMOKE_DIAG_DIR }}/
|
|
retention-days: 14
|
|
if-no-files-found: ignore
|
|
|
|
- name: Cleanup
|
|
if: always()
|
|
run: |
|
|
if [[ -f "$RUNNER_TEMP/paperclip-server.pid" ]]; then
|
|
kill "$(cat "$RUNNER_TEMP/paperclip-server.pid")" 2>/dev/null || true
|
|
fi
|
|
docker rm -f "$HERMES_CONTAINER_NAME" >/dev/null 2>&1 || true
|