From e211b6f30ee3798519afc7fcd734865bb5187043 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 09:51:44 +0800 Subject: [PATCH] test: run only affected unit suites (#45034) Co-authored-by: Brendonovich <14191578+Brendonovich@users.noreply.github.com> --- .github/workflows/test.yml | 21 ++++++++++++++++++--- turbo.json | 10 ++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 38e595aa022..3a654181b1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,6 +71,7 @@ jobs: uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 - name: Setup Node uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 @@ -110,9 +111,16 @@ jobs: - name: Run unit tests timeout-minutes: 20 - run: GITHUB_ACTIONS=false bun turbo test + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + GITHUB_ACTIONS=false bun turbo test + exit 0 + fi + GITHUB_ACTIONS=false bun turbo test --affected env: OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ runner.os == 'Windows' && 'true' || 'false' }} + TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha || github.event.before }} + TURBO_SCM_HEAD: ${{ github.sha }} - name: Verify published codemode package if: runner.os == 'Linux' @@ -122,8 +130,15 @@ jobs: - name: Verify packed workerd SDK if: runner.os == 'Linux' timeout-minutes: 15 - working-directory: packages/sdk - run: bun run verify:package + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + bun turbo verify:package --filter=@opencode-ai/sdk + exit 0 + fi + bun turbo verify:package --affected --filter=@opencode-ai/sdk + env: + TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha || github.event.before }} + TURBO_SCM_HEAD: ${{ github.sha }} - name: Verify compiled service lifecycle if: always() diff --git a/turbo.json b/turbo.json index 3ee09f0fcbe..89ae3dc0daf 100644 --- a/turbo.json +++ b/turbo.json @@ -1,5 +1,12 @@ { "$schema": "https://v2-8-13.turborepo.dev/schema.json", + "globalDependencies": [ + "patches/**", + "bunfig.toml", + ".npmrc", + ".github/actions/setup-bun/**", + ".github/workflows/test.yml" + ], "globalEnv": ["CI", "OPENCODE_DISABLE_SHARE"], "globalPassThroughEnv": ["CI", "OPENCODE_DISABLE_SHARE"], "tasks": { @@ -53,6 +60,9 @@ "@opencode-ai/session-ui#test": { "dependsOn": ["^build"], "outputs": [] + }, + "@opencode-ai/sdk#verify:package": { + "outputs": [] } } }