agent_servers_e2e.yml

  1name: Agent Servers E2E Tests
  2
  3on:
  4  schedule:
  5    # Run once a day at 2:00 AM UTC
  6    - cron: "0 2 * * *"
  7
  8  push:
  9    branches:
 10      - main
 11      - "v[0-9]+.[0-9]+.x"
 12    paths:
 13      - "crates/agent_servers/**"
 14      - "crates/acp_thread/**"
 15      - ".github/workflows/agent_servers_e2e.yml"
 16
 17  pull_request:
 18    branches:
 19      - "**"
 20    paths:
 21      - "crates/agent_servers/**"
 22      - "crates/acp_thread/**"
 23      - ".github/workflows/agent_servers_e2e.yml"
 24
 25  workflow_dispatch:
 26
 27concurrency:
 28  group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
 29  cancel-in-progress: true
 30
 31env:
 32  CARGO_TERM_COLOR: always
 33  CARGO_INCREMENTAL: 0
 34  RUST_BACKTRACE: 1
 35  ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
 36  GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
 37
 38jobs:
 39  e2e-tests:
 40    name: Run Agent Servers E2E Tests
 41    if: github.repository_owner == 'zed-industries'
 42    timeout-minutes: 60
 43    runs-on:
 44      - buildjet-16vcpu-ubuntu-2204
 45
 46    steps:
 47      - name: Checkout repo
 48        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
 49        with:
 50          clean: false
 51
 52      - name: Checkout gemini-cli repo
 53        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
 54        with:
 55          repository: zed-industries/gemini-cli
 56          ref: migrate-acp
 57          path: gemini-cli
 58          clean: false
 59
 60      - name: Install Rust
 61        shell: bash -euxo pipefail {0}
 62        run: |
 63          cargo install cargo-nextest --locked
 64
 65      - name: Install Node
 66        uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
 67        with:
 68          node-version: "18"
 69
 70      - name: Install Claude Code CLI
 71        shell: bash -euxo pipefail {0}
 72        run: |
 73          npm install -g @anthropic-ai/claude-code
 74          # Verify installation
 75          which claude || echo "Claude CLI not found in PATH"
 76          # Skip authentication if API key is not set (tests may use mock)
 77          if [ -n "$ANTHROPIC_API_KEY" ]; then
 78            echo "Anthropic API key is configured"
 79          fi
 80
 81      - name: Install and setup Gemini CLI
 82        shell: bash -euxo pipefail {0}
 83        run: |
 84          # Install globally for potential fallback
 85          npm install -g @google/gemini-cli
 86
 87          # Also install dependencies for local gemini-cli repo
 88          cd gemini-cli/packages/cli
 89          npm install
 90          cd -
 91
 92          # Verify installations
 93          which gemini || echo "Gemini CLI not found in PATH"
 94          # Skip authentication if API key is not set (tests may use mock)
 95          if [ -n "$GEMINI_API_KEY" ]; then
 96            echo "Gemini API key is configured"
 97          fi
 98
 99      - name: Limit target directory size
100        shell: bash -euxo pipefail {0}
101        run: script/clear-target-dir-if-larger-than 100
102
103      - name: Run E2E tests
104        shell: bash -euxo pipefail {0}
105        run: |
106          cargo nextest run \
107            --package agent_servers \
108            --features e2e \
109            --no-fail-fast
110
111      - name: Upload test results
112        if: failure()
113        uses: actions/upload-artifact@v4
114        with:
115          name: test-results
116          path: |
117            target/nextest/default/*.xml
118          retention-days: 7