From 6c32ba81e233792083731a3e00c8011ebe3405b0 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 00:33:14 +0800 Subject: [PATCH] test: skip unaffected app e2e tests (#45030) Co-authored-by: Brendonovich <14191578+Brendonovich@users.noreply.github.com> --- .github/workflows/test.yml | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d7c5787d9c9..0f4841c819f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,36 @@ env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true jobs: + affected: + name: affected packages + runs-on: blacksmith-4vcpu-ubuntu-2404 + outputs: + app: ${{ steps.packages.outputs.app }} + steps: + - name: Checkout repository + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + + - name: Setup Bun + uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 + with: + bun-version-file: package.json + + - name: Find affected packages + id: packages + env: + TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha || github.event.before }} + TURBO_SCM_HEAD: ${{ github.sha }} + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "app=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + bun x turbo@2.10.2 ls --affected --filter=@opencode-ai/app --output=json > affected.json + bun -e 'const result = await Bun.file("affected.json").json(); console.log(`app=${result.packages.count > 0}`)' >> "$GITHUB_OUTPUT" + unit: name: unit (${{ matrix.settings.name }}) strategy: @@ -133,7 +163,8 @@ jobs: e2e: name: e2e (${{ matrix.settings.name }}) - if: github.ref_name != 'v2' && github.head_ref != 'v2' + needs: affected + if: needs.affected.outputs.app == 'true' && github.ref_name != 'v2' && github.head_ref != 'v2' strategy: fail-fast: false matrix: