name: e2e-native-opencode on: # #3085: runs on every PR by default (reverts #2637's hot-file gate, which let untested changes ship). pull_request: schedule: - cron: '30 16 * * *' workflow_dispatch: concurrency: # #2637 plan #3: schedule-safe group — master pushes must not cancel the # day's nightly run; same-ref pushes still supersede each other. group: e2e-native-opencode-${{ github.event_name == 'schedule' && 'nightly' || github.ref }} cancel-in-progress: true jobs: e2e-native-opencode: name: real opencode native lane vs deterministic fake upstream (zero tokens) runs-on: ubuntu-latest timeout-minutes: 15 # Transient runner↔registry blips (ECONNRESET) must not red a PR (#2611): # raise npm's built-in fetch retry (default 2) so a ~10s jitter rides out # instead of aborting setup. Job-level → covers every registry op here # (global CLI install AND `npm ci`). Bounded: worst case ~+2 min before a # genuine sustained outage still fails fast. env: npm_config_fetch_retries: '5' npm_config_fetch_retry_mintimeout: '5000' npm_config_fetch_retry_maxtimeout: '60000' steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: npm # Pinned like pi/codex (#815): opencode's plugin/config API surface must # not drift under this suite. Bump deliberately after re-running the # suite locally on the new version. 2.0.3 = V2 `setup` lane, verified # end-to-end (the same suite drives 1.x via E2E_OC_BIN). - name: Install opencode CLI run: npm i -g @opencode/cli@2.0.3 - name: Print opencode version run: opencode --version - name: Install deps run: npm ci - name: Build run: npm run build - name: Run real-opencode native-lane compression E2E env: E2E_OC_BIN: opencode run: ACP_TEST_E2E_OC_NATIVE=1 node --import tsx --test tests/e2e/e2e-native-opencode.test.ts - name: Collect E2E artifacts if: failure() run: | mkdir -p tmp/e2e-artifacts for d in tmp/e2e-native-opencode-*; do [ -d "$d" ] && cp -r "$d" tmp/e2e-artifacts/ || true; done - uses: actions/upload-artifact@v4 if: failure() with: name: e2e-native-opencode-artifacts path: tmp/e2e-artifacts if-no-files-found: ignore e2e-opencode-responses-ws: name: OpenCode V2 Responses WebSocket ACP (zero tokens) runs-on: ubuntu-latest timeout-minutes: 10 # Transient runner↔registry blips (ECONNRESET) must not red a PR (#2611): # raise npm's built-in fetch retry (default 2) so a ~10s jitter rides out # instead of aborting setup. Job-level → covers every registry op here # (global CLI install AND `npm ci`). Bounded: worst case ~+2 min before a # genuine sustained outage still fails fast. env: npm_config_fetch_retries: '5' npm_config_fetch_retry_mintimeout: '5000' npm_config_fetch_retry_maxtimeout: '60000' steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 cache: npm - name: Install WebSocket-capable OpenCode V2 run: npm i -g @opencode/cli@2.0.20 - name: Install deps run: npm ci - name: Build run: npm run build - name: Run native Responses WebSocket ACP regression env: E2E_OC_BIN: opencode run: ACP_TEST_E2E_OC_WS=1 node --import tsx --test tests/e2e/e2e-opencode-responses-ws.test.ts - uses: actions/upload-artifact@v4 if: failure() with: name: e2e-opencode-responses-ws-artifacts path: /tmp/bili-oc-ws-e2e-* if-no-files-found: ignore