-
Notifications
You must be signed in to change notification settings - Fork 75
146 lines (137 loc) · 5.75 KB
/
Copy pathci.yml
File metadata and controls
146 lines (137 loc) · 5.75 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
env:
# uv.lock pins packages to Databricks' internal pypi-proxy, which hosted
# GitHub runners can't reach (downloads time out). Re-resolve against
# public PyPI at CI time: UV_INDEX_URL + a `uv lock` before install.
UV_INDEX_URL: https://pypi.org/simple
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- run: uv lock
- run: uv run pytest --ignore=tests/test_e2e.py
e2e-shards:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- group: gateway
name: Gateway API tests
keyword: not (TestCodexLaunch or TestClaudeLaunch or TestConfigureSubset or TestModelProviderLaunch or TestGeminiLaunch or TestGeminiFreshInstall or TestGeminiAuthRecovery or TestOpencodeLaunch or TestCopilotLaunch or TestPiLaunch)
package: ''
- group: claude
name: Agent launch tests · Claude
keyword: TestClaudeLaunch or TestConfigureSubset or (TestModelProviderLaunch and not codex)
package: '@anthropic-ai/claude-code@2.1.274'
- group: codex
name: Agent launch tests · Codex
keyword: TestCodexLaunch or (TestModelProviderLaunch and codex)
package: '@openai/codex'
- group: gemini
name: Agent launch tests · Gemini
keyword: TestGeminiLaunch or TestGeminiFreshInstall or TestGeminiAuthRecovery
package: '@google/gemini-cli'
- group: opencode
name: Agent launch tests · OpenCode
keyword: TestOpencodeLaunch
package: opencode-ai@1
- group: copilot
name: Agent launch tests · Copilot
keyword: TestCopilotLaunch
package: '@github/copilot@1.0.80'
- group: pi
name: Agent launch tests · Pi
keyword: TestPiLaunch
package: '@earendil-works/pi-coding-agent'
env:
# See the test job: hosted runners can't reach the internal pypi-proxy,
# so resolve against public PyPI (paired with the `uv lock` step below).
UV_INDEX_URL: https://pypi.org/simple
UCODE_TEST_WORKSPACE: ${{ secrets.UCODE_TEST_WORKSPACE }}
DATABRICKS_HOST: ${{ secrets.UCODE_TEST_WORKSPACE }}
# DATABRICKS_BEARER is the CI escape hatch: `databricks auth token`
# only retrieves cached user-OAuth tokens, so on a hosted runner
# (no databrickscfg, no cached login) it can never produce a bearer.
# Pre-fetch one (e.g. via M2M OAuth client_credentials against
# /oidc/v1/token) and store it as a repo secret. Both
# has_valid_databricks_auth + get_databricks_token + the agents'
# apiKeyHelper short-circuit to this value when set. Tokens are
# short-lived (~1h); rotate when CI starts failing with 401s.
DATABRICKS_BEARER: ${{ secrets.DATABRICKS_BEARER }}
# Subscription OAuth token for the relayed-launch e2e test; the test skips when unset.
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
AGENT_PACKAGE: ${{ matrix.package }}
TEST_KEYWORD: ${{ matrix.keyword }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: databricks/setup-cli@bdb89f81c11a5bd647fd55b585b7c396ec68a25a # v1.0.0
- name: Install the shard's agent CLI
if: ${{ matrix.package != '' }}
run: npm install -g "$AGENT_PACKAGE"
- run: uv lock
- run: uv tool install .
# Redirect stdin so any interactive `databricks auth login --no-browser`
# fallback EOFs instead of hanging the runner. With DATABRICKS_BEARER
# set, the auth code path doesn't shell out at all — this is a safety
# net for any code path we may have missed.
- run: uv run pytest tests/test_e2e.py -v -k "$TEST_KEYWORD" < /dev/null
e2e:
name: All agent tests
if: ${{ !cancelled() }}
needs: e2e-shards
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require every e2e shard to pass
env:
RESULT: ${{ needs.e2e-shards.result }}
run: test "$RESULT" = success
integration:
name: Integration
# Start alongside unit/agent tests. Only the final required-e2e gate
# waits for both suites; an agent failure must not skip integration.
if: ${{ !cancelled() }}
uses: ./.github/workflows/integration.yml
secrets: inherit
# Preserve the exact contexts required by the repository's branch rules.
# Keep these aliases until the rules and all active branches migrate together.
required-tests:
name: test
if: ${{ !cancelled() }}
needs: test
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require unit tests to pass
env:
RESULT: ${{ needs.test.result }}
run: test "$RESULT" = success
required-e2e:
name: e2e
if: ${{ !cancelled() }}
needs: [e2e, integration]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require all agent and integration tests to pass
env:
RESULT: ${{ needs.e2e.result }}
INTEGRATION_RESULT: ${{ needs.integration.result }}
run: test "$RESULT" = success && test "$INTEGRATION_RESULT" = success