1name: Agent Servers E2E Tests
2
3on:
4 schedule:
5 - cron: "0 12 * * *"
6
7 push:
8 branches:
9 - as-e2e-ci
10
11 pull_request:
12 branches:
13 - "**"
14 paths:
15 - "crates/agent_servers/**"
16 - "crates/acp_thread/**"
17 - ".github/workflows/agent_servers_e2e.yml"
18
19 workflow_dispatch:
20
21concurrency:
22 group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
23 cancel-in-progress: true
24
25env:
26 CARGO_TERM_COLOR: always
27 CARGO_INCREMENTAL: 0
28 RUST_BACKTRACE: 1
29 ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
30 # GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
31
32jobs:
33 e2e-tests:
34 name: Run Agent Servers E2E Tests
35 if: github.repository_owner == 'zed-industries'
36 timeout-minutes: 20
37 runs-on:
38 - buildjet-16vcpu-ubuntu-2204
39
40 steps:
41 - name: Add Rust to the PATH
42 run: echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
43
44 - name: Checkout repo
45 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
46 with:
47 clean: false
48
49 # - name: Checkout gemini-cli repo
50 # uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
51 # with:
52 # repository: zed-industries/gemini-cli
53 # ref: migrate-acp
54 # path: gemini-cli
55 # clean: false
56
57 - name: Cache dependencies
58 uses: swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2
59 with:
60 save-if: ${{ github.ref == 'refs/heads/main' }}
61 cache-provider: "buildjet"
62
63 - name: Install Linux dependencies
64 run: ./script/linux
65
66 - name: Configure CI
67 run: |
68 mkdir -p ./../.cargo
69 cp ./.cargo/ci-config.toml ./../.cargo/config.toml
70
71 - name: Install Node
72 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
73 with:
74 node-version: "18"
75
76 - name: Install Claude Code CLI
77 shell: bash -euxo pipefail {0}
78 run: |
79 npm install -g @anthropic-ai/claude-code
80 # Verify installation
81 which claude || echo "Claude CLI not found in PATH"
82 # Skip authentication if API key is not set (tests may use mock)
83 if [ -n "$ANTHROPIC_API_KEY" ]; then
84 echo "Anthropic API key is configured"
85 fi
86
87 # - name: Install and setup Gemini CLI
88 # shell: bash -euxo pipefail {0}
89 # run: |
90 # # Also install dependencies for local gemini-cli repo
91 # pushd gemini-cli
92 # npm install
93 # npm run build
94 # popd
95
96 # # Verify installations
97 # which gemini || echo "Gemini CLI not found in PATH"
98 # # Skip authentication if API key is not set (tests may use mock)
99 # if [ -n "$GEMINI_API_KEY" ]; then
100 # echo "Gemini API key is configured"
101 # fi
102
103 - name: Limit target directory size
104 shell: bash -euxo pipefail {0}
105 run: script/clear-target-dir-if-larger-than 100
106
107 - name: Install nextest
108 shell: bash -euxo pipefail {0}
109 run: |
110 cargo install cargo-nextest --locked
111
112 - name: Run E2E tests
113 shell: bash -euxo pipefail {0}
114 run: |
115 cargo nextest run \
116 --package agent_servers \
117 --features e2e \
118 --no-fail-fast \
119 claude
120
121 # Even the Linux runner is not stateful, in theory there is no need to do this cleanup.
122 # But, to avoid potential issues in the future if we choose to use a stateful Linux runner and forget to add code
123 # to clean up the config file, I’ve included the cleanup code here as a precaution.
124 # While it’s not strictly necessary at this moment, I believe it’s better to err on the side of caution.
125 - name: Clean CI config file
126 if: always()
127 run: rm -rf ./../.cargo