From edd89aab96366e2daa0145ce8087ccbaf8d61d8d Mon Sep 17 00:00:00 2001 From: yanyihan Date: Mon, 22 Jun 2026 22:33:51 +0800 Subject: [PATCH 01/16] ci: split tests into 4 shards, remove turbo test tasks - Use bun test --shard directly in packages/opencode instead of turbo - Run 4 parallel shards with fail-fast: false so all shards complete - Remove @mimo-ai/cli and @mimo-ai/app test tasks from turbo.json - Keep turbo for typecheck and build only --- .github/workflows/test.yml | 20 ++++++++++---------- turbo.json | 19 ------------------- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d3d33498d..1caa17b29 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,6 +17,11 @@ permissions: jobs: unit: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + shard: [1, 2, 3, 4] + name: unit (shard ${{ matrix.shard }}/4) steps: - name: Checkout repository uses: actions/checkout@v4 @@ -29,15 +34,10 @@ jobs: git config --global user.email "ci@mimo.ai" git config --global user.name "mimo-ci" - - name: Cache Turbo - uses: actions/cache@v4 - with: - path: node_modules/.cache/turbo - key: turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json') }}-${{ github.sha }} - restore-keys: | - turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json') }}- - turbo-${{ runner.os }}- + - name: Build dependencies + run: bun turbo build --output-logs=errors-only - - name: Run unit tests + - name: Run unit tests (shard ${{ matrix.shard }}/4) timeout-minutes: 20 - run: bun turbo test --output-logs=errors-only --log-order=grouped --log-prefix=task + working-directory: packages/opencode + run: bun test --timeout 30000 --shard ${{ matrix.shard }}/4 diff --git a/turbo.json b/turbo.json index b8c75e581..8f4053581 100644 --- a/turbo.json +++ b/turbo.json @@ -7,25 +7,6 @@ "build": { "dependsOn": [], "outputs": ["dist/**"] - }, - "@mimo-ai/cli#test": { - "dependsOn": ["^build"], - "outputs": [], - "passThroughEnv": ["*"] - }, - "@mimo-ai/cli#test:ci": { - "dependsOn": ["^build"], - "outputs": [".artifacts/unit/junit.xml"], - "passThroughEnv": ["*"] - }, - "@mimo-ai/app#test": { - "dependsOn": ["^build"], - "outputs": [] - }, - "@mimo-ai/app#test:ci": { - "dependsOn": ["^build"], - "outputs": [".artifacts/unit/junit.xml"], - "passThroughEnv": ["*"] } } } From 8c305a13c241d1ce47490bf277a581f26873d54a Mon Sep 17 00:00:00 2001 From: yanyihan Date: Mon, 22 Jun 2026 22:48:21 +0800 Subject: [PATCH 02/16] ci: remove build step, use string shards --- .github/workflows/test.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1caa17b29..b4f675ccb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,8 +20,8 @@ jobs: strategy: fail-fast: false matrix: - shard: [1, 2, 3, 4] - name: unit (shard ${{ matrix.shard }}/4) + shard: ["1/4", "2/4", "3/4", "4/4"] + name: unit (shard ${{ matrix.shard }}) steps: - name: Checkout repository uses: actions/checkout@v4 @@ -34,10 +34,7 @@ jobs: git config --global user.email "ci@mimo.ai" git config --global user.name "mimo-ci" - - name: Build dependencies - run: bun turbo build --output-logs=errors-only - - - name: Run unit tests (shard ${{ matrix.shard }}/4) + - name: Run unit tests (shard ${{ matrix.shard }}) timeout-minutes: 20 working-directory: packages/opencode - run: bun test --timeout 30000 --shard ${{ matrix.shard }}/4 + run: bun test --timeout 30000 --shard ${{ matrix.shard }} From 37b84672abc4c2ebdd098267dcb8873cf8cd058e Mon Sep 17 00:00:00 2001 From: yanyihan Date: Mon, 22 Jun 2026 22:48:48 +0800 Subject: [PATCH 03/16] =?UTF-8?q?ci:=20turbo.json=20=E5=8F=AA=E7=95=99=20t?= =?UTF-8?q?ypecheck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- turbo.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/turbo.json b/turbo.json index 8f4053581..2dde014cf 100644 --- a/turbo.json +++ b/turbo.json @@ -3,10 +3,6 @@ "globalEnv": ["CI", "OPENCODE_DISABLE_SHARE"], "globalPassThroughEnv": ["CI", "OPENCODE_DISABLE_SHARE"], "tasks": { - "typecheck": {}, - "build": { - "dependsOn": [], - "outputs": ["dist/**"] - } + "typecheck": {} } } From 8f22989dc000f914faaf7a8270a42b491af1ea95 Mon Sep 17 00:00:00 2001 From: yanyihan Date: Mon, 22 Jun 2026 22:51:56 +0800 Subject: [PATCH 04/16] fix: use --shard=N/4 syntax for bun test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4f675ccb..34648c205 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,4 +37,4 @@ jobs: - name: Run unit tests (shard ${{ matrix.shard }}) timeout-minutes: 20 working-directory: packages/opencode - run: bun test --timeout 30000 --shard ${{ matrix.shard }} + run: bun test --timeout 30000 --shard=${{ matrix.shard }} From c81cf603eda8d5c83d239183404136846b4b8780 Mon Sep 17 00:00:00 2001 From: yanyihan Date: Mon, 22 Jun 2026 22:55:35 +0800 Subject: [PATCH 05/16] ci: pin bun 1.3.14, remove git identity config --- .github/workflows/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 34648c205..f4aeef896 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,12 +27,12 @@ jobs: uses: actions/checkout@v4 - name: Setup Bun - uses: ./.github/actions/setup-bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: "1.3.14" - - name: Configure git identity - run: | - git config --global user.email "ci@mimo.ai" - git config --global user.name "mimo-ci" + - name: Install dependencies + run: bun install --frozen-lockfile - name: Run unit tests (shard ${{ matrix.shard }}) timeout-minutes: 20 From 9daec8a6612a243513de9db78ff79d5ceae439e2 Mon Sep 17 00:00:00 2001 From: yanyihan Date: Mon, 22 Jun 2026 22:56:19 +0800 Subject: [PATCH 06/16] ci: bump bun to 1.3.14 via packageManager, revert to shared setup-bun --- .github/workflows/test.yml | 7 +------ package.json | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4aeef896..7abc5668a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,12 +27,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: "1.3.14" - - - name: Install dependencies - run: bun install --frozen-lockfile + uses: ./.github/actions/setup-bun - name: Run unit tests (shard ${{ matrix.shard }}) timeout-minutes: 20 diff --git a/package.json b/package.json index e9e3c9b12..60859b481 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "AI-powered development tool", "private": true, "type": "module", - "packageManager": "bun@1.3.11", + "packageManager": "bun@1.3.14", "scripts": { "dev": "MIMOCODE_HOME=$PWD/.dev-home bun run --cwd packages/opencode --conditions=browser src/index.ts", "dev:desktop": "bun --cwd packages/desktop dev", From 700f051a2b9ce061c73c06ce3d8124bacafa9324 Mon Sep 17 00:00:00 2001 From: yanyihan Date: Mon, 22 Jun 2026 23:23:06 +0800 Subject: [PATCH 07/16] ci: JUnit artifacts per shard, update action versions - Restore git identity for husky compatibility - Switch to test:ci script with JUnit reporter + upload artifact per shard - Bump actions/checkout to v6, actions/cache to v5, upload-artifact to v7 - Remove RUNNER_ARCH guard in setup-bun (only ubuntu CI for now) --- .github/actions/setup-bun/action.yml | 18 ++++++++---------- .github/workflows/lint.yml | 2 +- .github/workflows/test.yml | 16 ++++++++++++++-- .github/workflows/typecheck.yml | 2 +- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.yml index d1e3bfc25..6f63bc798 100644 --- a/.github/actions/setup-bun/action.yml +++ b/.github/actions/setup-bun/action.yml @@ -7,15 +7,13 @@ runs: id: bun-url shell: bash run: | - if [ "$RUNNER_ARCH" = "X64" ]; then - V=$(node -p "require('./package.json').packageManager.split('@')[1]") - case "$RUNNER_OS" in - macOS) OS=darwin ;; - Linux) OS=linux ;; - Windows) OS=windows ;; - esac - echo "url=https://github.com/oven-sh/bun/releases/download/bun-v${V}/bun-${OS}-x64-baseline.zip" >> "$GITHUB_OUTPUT" - fi + V=$(node -p "require('./package.json').packageManager.split('@')[1]") + case "$RUNNER_OS" in + macOS) OS=darwin ;; + Linux) OS=linux ;; + Windows) OS=windows ;; + esac + echo "url=https://github.com/oven-sh/bun/releases/download/bun-v${V}/bun-${OS}-x64-baseline.zip" >> "$GITHUB_OUTPUT" - name: Setup Bun uses: oven-sh/setup-bun@v2 @@ -29,7 +27,7 @@ runs: run: echo "dir=$(bun pm cache)" >> "$GITHUB_OUTPUT" - name: Cache Bun dependencies - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ${{ steps.cache.outputs.dir }} key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6a1291d49..e68c4803c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Bun uses: ./.github/actions/setup-bun diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7abc5668a..99330714c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,12 +24,24 @@ jobs: name: unit (shard ${{ matrix.shard }}) steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Bun uses: ./.github/actions/setup-bun + - name: Configure git identity + run: | + git config --global user.email "ci@mimo.ai" + git config --global user.name "mimo-ci" + - name: Run unit tests (shard ${{ matrix.shard }}) timeout-minutes: 20 working-directory: packages/opencode - run: bun test --timeout 30000 --shard=${{ matrix.shard }} + run: bun run test:ci --shard=${{ matrix.shard }} + + - name: Upload JUnit + if: always() + uses: actions/upload-artifact@v7 + with: + name: junit-shard-${{ strategy.job-index }} + path: packages/opencode/.artifacts/unit/junit.xml diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index d99646c49..903ca0eba 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Bun uses: ./.github/actions/setup-bun From 84cb4b97fe613f02e1b47e0209efe0f0f9999db5 Mon Sep 17 00:00:00 2001 From: yanyihan Date: Mon, 22 Jun 2026 23:35:52 +0800 Subject: [PATCH 08/16] ci: remove setuptools, simplify setup-bun --- .github/actions/setup-bun/action.yml | 38 ++++------------------------ 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.yml index 6f63bc798..86853154e 100644 --- a/.github/actions/setup-bun/action.yml +++ b/.github/actions/setup-bun/action.yml @@ -3,49 +3,21 @@ description: "Setup Bun with caching and install dependencies" runs: using: "composite" steps: - - name: Get baseline download URL - id: bun-url - shell: bash - run: | - V=$(node -p "require('./package.json').packageManager.split('@')[1]") - case "$RUNNER_OS" in - macOS) OS=darwin ;; - Linux) OS=linux ;; - Windows) OS=windows ;; - esac - echo "url=https://github.com/oven-sh/bun/releases/download/bun-v${V}/bun-${OS}-x64-baseline.zip" >> "$GITHUB_OUTPUT" - - name: Setup Bun uses: oven-sh/setup-bun@v2 with: - bun-version-file: ${{ !steps.bun-url.outputs.url && 'package.json' || '' }} - bun-download-url: ${{ steps.bun-url.outputs.url }} - - - name: Get cache directory - id: cache - shell: bash - run: echo "dir=$(bun pm cache)" >> "$GITHUB_OUTPUT" + bun-version-file: "package.json" - name: Cache Bun dependencies uses: actions/cache@v5 with: - path: ${{ steps.cache.outputs.dir }} + path: | + ~/.bun/install/cache + **/node_modules key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} restore-keys: | ${{ runner.os }}-bun- - - name: Install setuptools for distutils compatibility - run: python3 -m pip install setuptools || pip install setuptools || true - shell: bash - - name: Install dependencies - run: | - # Workaround for patched peer variants - # e.g. ./patches/ for standard-openapi - # https://github.com/oven-sh/bun/issues/28147 - if [ "$RUNNER_OS" = "Windows" ]; then - bun install --linker hoisted - else - bun install - fi + run: bun install shell: bash From 752a88c520f79578b84578da2f4eea61add28a29 Mon Sep 17 00:00:00 2001 From: yanyihan Date: Mon, 22 Jun 2026 23:47:20 +0800 Subject: [PATCH 09/16] ci: reduce shard timeout from 20min to 8min --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99330714c..ee682f274 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,7 @@ jobs: git config --global user.name "mimo-ci" - name: Run unit tests (shard ${{ matrix.shard }}) - timeout-minutes: 20 + timeout-minutes: 8 working-directory: packages/opencode run: bun run test:ci --shard=${{ matrix.shard }} From 1320f9e56526871f49db795a630d705627f2060e Mon Sep 17 00:00:00 2001 From: yanyihan Date: Mon, 22 Jun 2026 23:48:04 +0800 Subject: [PATCH 10/16] ci: use space-separated --shard syntax (bun 1.3.14) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ee682f274..c601b0d60 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: - name: Run unit tests (shard ${{ matrix.shard }}) timeout-minutes: 8 working-directory: packages/opencode - run: bun run test:ci --shard=${{ matrix.shard }} + run: bun run test:ci --shard ${{ matrix.shard }} - name: Upload JUnit if: always() From 9d6d396c4f03c4e4dd137b09a4713e638b7addb8 Mon Sep 17 00:00:00 2001 From: yanyihan Date: Tue, 23 Jun 2026 00:07:14 +0800 Subject: [PATCH 11/16] ci: remove **/node_modules from cache path --- .github/actions/setup-bun/action.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.yml index 86853154e..081190743 100644 --- a/.github/actions/setup-bun/action.yml +++ b/.github/actions/setup-bun/action.yml @@ -11,9 +11,7 @@ runs: - name: Cache Bun dependencies uses: actions/cache@v5 with: - path: | - ~/.bun/install/cache - **/node_modules + path: ~/.bun/install/cache key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} restore-keys: | ${{ runner.os }}-bun- From 4d243512648a6db6b0ad7abbfb90aee5491b527e Mon Sep 17 00:00:00 2001 From: yanyihan Date: Tue, 23 Jun 2026 00:19:10 +0800 Subject: [PATCH 12/16] ci: remove bun install cache (bun is fast enough without it) --- .github/actions/setup-bun/action.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.yml index 081190743..fdfd20def 100644 --- a/.github/actions/setup-bun/action.yml +++ b/.github/actions/setup-bun/action.yml @@ -8,14 +8,6 @@ runs: with: bun-version-file: "package.json" - - name: Cache Bun dependencies - uses: actions/cache@v5 - with: - path: ~/.bun/install/cache - key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} - restore-keys: | - ${{ runner.os }}-bun- - - name: Install dependencies run: bun install shell: bash From 5b4a2b059a03a2dc215c4f072fb197ba597f511a Mon Sep 17 00:00:00 2001 From: yanyihan Date: Tue, 23 Jun 2026 00:20:54 +0800 Subject: [PATCH 13/16] ci: inline setup-bun, remove composite action --- .github/actions/setup-bun/action.yml | 13 ------------- .github/workflows/lint.yml | 7 ++++++- .github/workflows/test.yml | 7 ++++++- .github/workflows/typecheck.yml | 7 ++++++- 4 files changed, 18 insertions(+), 16 deletions(-) delete mode 100644 .github/actions/setup-bun/action.yml diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.yml deleted file mode 100644 index fdfd20def..000000000 --- a/.github/actions/setup-bun/action.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: "Setup Bun" -description: "Setup Bun with caching and install dependencies" -runs: - using: "composite" - steps: - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version-file: "package.json" - - - name: Install dependencies - run: bun install - shell: bash diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e68c4803c..65502a890 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,12 @@ jobs: uses: actions/checkout@v6 - name: Setup Bun - uses: ./.github/actions/setup-bun + uses: oven-sh/setup-bun@v2 + with: + bun-version-file: "package.json" + + - name: Install dependencies + run: bun install - name: Run oxlint run: bun lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c601b0d60..95d9f6f65 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,12 @@ jobs: uses: actions/checkout@v6 - name: Setup Bun - uses: ./.github/actions/setup-bun + uses: oven-sh/setup-bun@v2 + with: + bun-version-file: "package.json" + + - name: Install dependencies + run: bun install - name: Configure git identity run: | diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index 903ca0eba..08ba03f95 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -15,7 +15,12 @@ jobs: uses: actions/checkout@v6 - name: Setup Bun - uses: ./.github/actions/setup-bun + uses: oven-sh/setup-bun@v2 + with: + bun-version-file: "package.json" + + - name: Install dependencies + run: bun install - name: Run typecheck run: bun typecheck From 395f67330efa20a4703f20fd02168ecee841d009 Mon Sep 17 00:00:00 2001 From: yanyihan Date: Tue, 23 Jun 2026 00:21:40 +0800 Subject: [PATCH 14/16] ci: remove bun-version-file (default behavior) --- .github/workflows/lint.yml | 2 -- .github/workflows/test.yml | 2 -- .github/workflows/typecheck.yml | 2 -- 3 files changed, 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 65502a890..e3976fb9b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,8 +16,6 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@v2 - with: - bun-version-file: "package.json" - name: Install dependencies run: bun install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 95d9f6f65..333411e3e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,8 +28,6 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@v2 - with: - bun-version-file: "package.json" - name: Install dependencies run: bun install diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index 08ba03f95..9d36ef343 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -16,8 +16,6 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@v2 - with: - bun-version-file: "package.json" - name: Install dependencies run: bun install From 89f42280d501619f98495227699e15ee53ff69be Mon Sep 17 00:00:00 2001 From: yanyihan Date: Tue, 23 Jun 2026 00:28:22 +0800 Subject: [PATCH 15/16] ci: add bun install cache with restore-keys fallback --- .github/workflows/lint.yml | 8 ++++++++ .github/workflows/test.yml | 8 ++++++++ .github/workflows/typecheck.yml | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e3976fb9b..44f9b7441 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,6 +17,14 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@v2 + - name: Cache Bun dependencies + uses: actions/cache@v5 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun- + - name: Install dependencies run: bun install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 333411e3e..dd6d0ae97 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,14 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@v2 + - name: Cache Bun dependencies + uses: actions/cache@v5 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun- + - name: Install dependencies run: bun install diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index 9d36ef343..d40c4cb57 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -17,6 +17,14 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@v2 + - name: Cache Bun dependencies + uses: actions/cache@v5 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun- + - name: Install dependencies run: bun install From b06c64f5dcace2b7715fee28f75552638d472f69 Mon Sep 17 00:00:00 2001 From: yanyihan Date: Tue, 23 Jun 2026 00:33:11 +0800 Subject: [PATCH 16/16] ci: extract shared setup-bun action, simplify CI - Simplify setup-bun action: remove baseline URL, setuptools, Windows hoisted - Bump actions: checkout@v6, cache@v5, upload-artifact@v7 - Test workflow: 4 shards, fail-fast=false, 8min timeout, JUnit artifacts - turbo.json: only keep typecheck (remove build + cli/app test tasks) - package.json: bump bun to 1.3.14 --- .github/actions/setup-bun/action.yml | 19 +++++++++++++++++++ .github/workflows/lint.yml | 13 +------------ .github/workflows/test.yml | 13 +------------ .github/workflows/typecheck.yml | 13 +------------ 4 files changed, 22 insertions(+), 36 deletions(-) create mode 100644 .github/actions/setup-bun/action.yml diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.yml new file mode 100644 index 000000000..4b5e11d57 --- /dev/null +++ b/.github/actions/setup-bun/action.yml @@ -0,0 +1,19 @@ +name: "Setup Bun" +description: "Setup Bun, cache dependencies, and install" +runs: + using: "composite" + steps: + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + + - name: Cache Bun dependencies + uses: actions/cache@v5 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun- + + - name: Install dependencies + run: bun install + shell: bash diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 44f9b7441..e68c4803c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,18 +15,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Bun - uses: oven-sh/setup-bun@v2 - - - name: Cache Bun dependencies - uses: actions/cache@v5 - with: - path: ~/.bun/install/cache - key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} - restore-keys: | - ${{ runner.os }}-bun- - - - name: Install dependencies - run: bun install + uses: ./.github/actions/setup-bun - name: Run oxlint run: bun lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd6d0ae97..c601b0d60 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,18 +27,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Bun - uses: oven-sh/setup-bun@v2 - - - name: Cache Bun dependencies - uses: actions/cache@v5 - with: - path: ~/.bun/install/cache - key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} - restore-keys: | - ${{ runner.os }}-bun- - - - name: Install dependencies - run: bun install + uses: ./.github/actions/setup-bun - name: Configure git identity run: | diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index d40c4cb57..903ca0eba 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -15,18 +15,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Bun - uses: oven-sh/setup-bun@v2 - - - name: Cache Bun dependencies - uses: actions/cache@v5 - with: - path: ~/.bun/install/cache - key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} - restore-keys: | - ${{ runner.os }}-bun- - - - name: Install dependencies - run: bun install + uses: ./.github/actions/setup-bun - name: Run typecheck run: bun typecheck