@@ -24,44 +24,64 @@ jobs:
2424 - name : Detect repo meta
2525 id : meta
2626 run : |
27+ echo "has_bun_lock=$([ -f bun.lockb ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
2728 echo "has_package_json=$([ -f package.json ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
2829 echo "has_pnpm_lock=$([ -f pnpm-lock.yaml ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
2930 echo "has_yarn_lock=$([ -f yarn.lock ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
3031 echo "has_package_lock=$([ -f package-lock.json ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
3132 echo "has_cargo=$([ -n \"$(git ls-files | grep -E '(^|/)Cargo.toml$')\" ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
3233 echo "has_go=$([ -f go.mod ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
3334
35+ # --- JavaScript path (Bun/Node) ---
36+ - name : Setup Bun
37+ if : steps.meta.outputs.has_bun_lock == 'true'
38+ uses : oven-sh/setup-bun@v1
39+ with :
40+ bun-version : ' 1.x'
41+
3442 - name : Setup Node
35- if : steps.meta.outputs.has_package_json == 'true'
43+ if : steps.meta.outputs.has_package_json == 'true' && steps.meta.outputs.has_bun_lock != 'true'
3644 uses : actions/setup-node@v4
3745 with :
3846 node-version : ' 20'
3947
4048 - name : Enable Corepack (Node)
41- if : steps.meta.outputs.has_package_json == 'true'
49+ if : steps.meta.outputs.has_package_json == 'true' && steps.meta.outputs.has_bun_lock != 'true'
4250 run : |
4351 npm i -g corepack || true
4452 corepack enable || true
4553 if [ "${{ steps.meta.outputs.has_yarn_lock }}" = "true" ]; then corepack prepare yarn@stable --activate || true; fi
4654
4755 - name : Setup pnpm
48- if : steps.meta.outputs.has_pnpm_lock == 'true'
56+ if : steps.meta.outputs.has_pnpm_lock == 'true' && steps.meta.outputs.has_bun_lock != 'true'
4957 uses : pnpm/action-setup@v4
5058 with :
5159 version : 9
5260
61+ - name : Install deps (Bun)
62+ if : steps.meta.outputs.has_bun_lock == 'true'
63+ run : |
64+ bun --version
65+ bun install --frozen-lockfile || bun install || true
66+
67+ - name : Build (Bun)
68+ if : steps.meta.outputs.has_bun_lock == 'true'
69+ run : |
70+ bun run build || true
71+
5372 - name : Install deps (Node)
54- if : steps.meta.outputs.has_package_json == 'true'
73+ if : steps.meta.outputs.has_package_json == 'true' && steps.meta.outputs.has_bun_lock != 'true'
5574 run : |
5675 if [ "${{ steps.meta.outputs.has_pnpm_lock }}" = "true" ]; then pnpm install --frozen-lockfile || pnpm install || true; fi
5776 if [ "${{ steps.meta.outputs.has_package_lock }}" = "true" ]; then npm ci || npm i || true; fi
5877 if [ "${{ steps.meta.outputs.has_yarn_lock }}" = "true" ]; then (yarn --version || true) && (yarn install --frozen-lockfile || yarn install || true); fi
5978
6079 - name : Build (Node)
61- if : steps.meta.outputs.has_package_json == 'true'
80+ if : steps.meta.outputs.has_package_json == 'true' && steps.meta.outputs.has_bun_lock != 'true'
6281 run : |
6382 pnpm run -c build || pnpm -r build || pnpm -w build || npm run build || yarn build || true
6483
84+ # --- Rust path ---
6585 - name : Setup Rust
6686 if : steps.meta.outputs.has_cargo == 'true'
6787 uses : dtolnay/rust-toolchain@stable
7090 if : steps.meta.outputs.has_cargo == 'true'
7191 run : cargo build --release || true
7292
93+ # --- Go path ---
7394 - name : Setup Go
7495 if : steps.meta.outputs.has_go == 'true'
7596 uses : actions/setup-go@v5
0 commit comments