Repository navigation
167 lines (134 loc) · 5.5 KB
/
Copy pathci.yml
File metadata and controls
167 lines (134 loc) · 5.5 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: CI
on:
pull_request:
push:
branches:
- main
schedule:
- cron: "17 4 * * *"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version: "24"
cache: npm
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: npm ci
- name: Verify extracted OpenCode adapter modules
run: |
node --check src/source/opencode/host.js
node --check src/source/opencode/messages.js
node --check src/source/opencode/commands.js
node --check scripts/command-lifecycle-test.mjs
node scripts/host-adapter-contract-test.mjs
node scripts/command-lifecycle-test.mjs
- run: npm run check
- name: Verify V2 runtime contracts
run: |
node --check src/source/runtime/events.js
node --check src/source/runtime/session-registry.js
node --check src/source/runtime/scope.js
node --check src/source/runtime/timers.js
node --check src/source/runtime/session-manager.js
node --check src/source/opencode2/capabilities.js
node --check src/source/opencode2/runtime-adapter.js
node --check src/source/opencode2/experimental.js
node --check scripts/runtime-contract-test.mjs
node --check scripts/runtime-scope-test.mjs
node --check scripts/session-manager-test.mjs
node --check scripts/v2-plugin-sentinel-test.mjs
node --check scripts/v2-runtime-adapter-test.mjs
node scripts/runtime-contract-test.mjs
node scripts/runtime-scope-test.mjs
node scripts/session-manager-test.mjs
node scripts/v2-plugin-sentinel-test.mjs
node scripts/v2-runtime-adapter-test.mjs
- run: npm test
- name: Verify Bun can load the plugin entries
run: bun -e "await import('./src/index.js'); const server = await import('./src/server.js'); if (typeof server.default?.server !== 'function' || typeof server.default?.setup !== 'function') throw new Error('dual server entry is invalid')"
# Issue #2 and OpenCode 2.0.11 both happen in the installer-created .ts plugin shape.
- name: "Regression #2 - verify dual local .ts plugin loads in Bun"
run: |
node -e "require('node:fs').copyFileSync('src/server.js', 'src/__opencode_loop_local_ci.ts')"
bun -e "const plugin = await import('./src/__opencode_loop_local_ci.ts'); if (typeof plugin.default?.server !== 'function' || typeof plugin.default?.setup !== 'function') throw new Error('dual local plugin contract is invalid')"
node -e "require('node:fs').rmSync('src/__opencode_loop_local_ci.ts', { force: true })"
opencode-peer-compat:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
plugin-version: ["1.4.0", "latest"]
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version: "24"
cache: npm
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: npm ci
- name: Install OpenCode plugin compatibility target
shell: bash
run: npm install --no-save --package-lock=false "@opencode-ai/plugin@${{ matrix.plugin-version }}"
- name: Show tested OpenCode plugin version
run: node -p "require('./node_modules/@opencode-ai/plugin/package.json').version"
- run: npm run check
- run: npm test
- name: Verify Bun can load with this OpenCode plugin
run: bun -e "await import('./src/index.js'); const server = await import('./src/server.js'); if (typeof server.default?.server !== 'function') throw new Error('V1 server contract is unavailable')"
- name: "Regression #2 - verify dual local .ts plugin loads with this OpenCode plugin"
run: |
node -e "require('node:fs').copyFileSync('src/server.js', 'src/__opencode_loop_local_ci.ts')"
bun -e "const plugin = await import('./src/__opencode_loop_local_ci.ts'); if (typeof plugin.default?.server !== 'function') throw new Error('V1 local server contract is unavailable')"
node -e "require('node:fs').rmSync('src/__opencode_loop_local_ci.ts', { force: true })"
real-opencode-loop:
name: real OpenCode loop (${{ matrix.os }})
timeout-minutes: 12
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version: "24"
cache: npm
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: npm ci
- name: Install current OpenCode CLI
run: npm install --no-save --package-lock=false opencode-ai@latest
- name: Show OpenCode version
run: npx --no-install opencode --version
- name: Run real-host Loop and queued Goal steering canaries
run: npm run canary:host
env:
OPENCODE_PRINT_LOGS: "1"
OPENCODE_LOG_LEVEL: DEBUG