eval.yml

 1name: Run Agent Eval
 2
 3on:
 4  schedule:
 5    - cron: "0 0 * * *"
 6
 7  pull_request:
 8    branches:
 9      - "**"
10    types: [opened, synchronize, reopened, labeled]
11
12  workflow_dispatch:
13
14concurrency:
15  # Allow only one workflow per any non-`main` branch.
16  group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
17  cancel-in-progress: true
18
19env:
20  CARGO_TERM_COLOR: always
21  CARGO_INCREMENTAL: 0
22  RUST_BACKTRACE: 1
23  ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
24  ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
25  ZED_EVAL_TELEMETRY: 1
26
27jobs:
28  # This is a no-op job that we run to prevent GitHub from marking the workflow
29  # as failed for PRs that don't have the `run-eval` label.
30  noop:
31    name: No-op
32    runs-on: ubuntu-latest
33    steps:
34      - name: No-op
35        run: echo "Nothing to do"
36
37  run_eval:
38    timeout-minutes: 60
39    name: Run Agent Eval
40    if: >
41      github.repository_owner == 'zed-industries' &&
42      (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-eval'))
43    runs-on:
44      - buildjet-16vcpu-ubuntu-2204
45    steps:
46      - name: Add Rust to the PATH
47        run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
48
49      - name: Checkout repo
50        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
51        with:
52          clean: false
53
54      - name: Cache dependencies
55        uses: swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2
56        with:
57          save-if: ${{ github.ref == 'refs/heads/main' }}
58          cache-provider: "buildjet"
59
60      - name: Install Linux dependencies
61        run: ./script/linux
62
63      - name: Configure CI
64        run: |
65          mkdir -p ./../.cargo
66          cp ./.cargo/ci-config.toml ./../.cargo/config.toml
67
68      - name: Compile eval
69        run: cargo build --package=eval
70
71      - name: Run eval
72        run: cargo run --package=eval -- --repetitions=8 --concurrency=1
73
74      # Even the Linux runner is not stateful, in theory there is no need to do this cleanup.
75      # But, to avoid potential issues in the future if we choose to use a stateful Linux runner and forget to add code
76      # to clean up the config file, I’ve included the cleanup code here as a precaution.
77      # While it’s not strictly necessary at this moment, I believe it’s better to err on the side of caution.
78      - name: Clean CI config file
79        if: always()
80        run: rm -rf ./../.cargo