-
Notifications
You must be signed in to change notification settings - Fork 71
129 lines (110 loc) · 3.74 KB
/
Copy pathe2e-tests.yml
File metadata and controls
129 lines (110 loc) · 3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: E2E Tests
on:
push:
branches: [main]
paths:
- 'packages/**'
- '!packages/sdk-swift/**'
- 'crates/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'scripts/e2e-test.sh'
- 'package.json'
- '.github/workflows/e2e-tests.yml'
pull_request:
branches: [main]
paths:
- 'packages/**'
- '!packages/sdk-swift/**'
- 'crates/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'scripts/e2e-test.sh'
- 'package.json'
- '.github/workflows/e2e-tests.yml'
# Allow manual trigger for on-demand testing
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
AGENT_RELAY_TELEMETRY_DISABLED: 1
jobs:
e2e-test:
name: E2E Integration Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node-version: [22.14.0]
fail-fast: false
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Ensure rollup optional dependencies are installed
run: npm install --no-save rollup || true
- name: Build project
run: npm run build
- name: Link CLI for local testing
run: cd packages/cli && npm link
- name: Verify CLI is available
run: agent-relay --version
- name: Cache Claude CLI
id: cache-claude
uses: actions/cache@v4
with:
path: ~/.npm-global
key: claude-cli-${{ runner.os }}-${{ hashFiles('.github/workflows/e2e-tests.yml') }}
- name: Install Claude CLI
if: steps.cache-claude.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
npm install -g @anthropic-ai/claude-code
- name: Add Claude CLI to PATH
run: |
echo "$HOME/.npm-global/bin" >> $GITHUB_PATH
export PATH="$HOME/.npm-global/bin:$PATH"
claude --version || echo "Claude CLI ready"
- name: Check for API key
id: check-key
run: |
if [ -n "$ANTHROPIC_API_KEY" ]; then
echo "has_key=true" >> $GITHUB_OUTPUT
else
echo "has_key=false" >> $GITHUB_OUTPUT
echo "::warning::ANTHROPIC_API_KEY not set - Claude spawn test will be skipped"
fi
- name: Run E2E test
id: e2e-test
if: steps.check-key.outputs.has_key == 'true'
timeout-minutes: 5
run: ./scripts/e2e-test.sh --port 3888
- name: Run daemon-only test (no API key)
if: steps.check-key.outputs.has_key == 'false'
timeout-minutes: 2
run: ./scripts/e2e-test.sh --daemon-only --port 3888
- name: Test Summary
if: always()
run: |
echo "## E2E Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **OS:** ${{ matrix.os }}" >> $GITHUB_STEP_SUMMARY
echo "- **Node:** ${{ matrix.node-version }}" >> $GITHUB_STEP_SUMMARY
echo "- **API Key Present:** ${{ steps.check-key.outputs.has_key }}" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.e2e-test.outcome }}" == "success" ]; then
echo "- **Status:** Passed" >> $GITHUB_STEP_SUMMARY
elif [ "${{ steps.e2e-test.outcome }}" == "skipped" ]; then
echo "- **Status:** Skipped (no API key)" >> $GITHUB_STEP_SUMMARY
else
echo "- **Status:** Failed" >> $GITHUB_STEP_SUMMARY
fi