Skip to content

Commit cfdb5a8

Browse files
killaguclaude
andcommitted
ci: add Bun CI workflow
Run tests on Bun runtime across ubuntu and macos. Patches vitest imports from vite-plus to vanilla vitest since Bun can't use the vite-plus wrapper. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1a37fde commit cfdb5a8

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/bun.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Bun CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
merge_group:
9+
10+
jobs:
11+
test:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: ['ubuntu-latest', 'macos-latest']
16+
17+
name: Test (Bun, ${{ matrix.os }})
18+
runs-on: ${{ matrix.os }}
19+
20+
concurrency:
21+
group: bun-${{ github.workflow }}-#${{ github.event.pull_request.number || github.head_ref || github.ref }}-(${{ matrix.os }})
22+
cancel-in-progress: true
23+
24+
steps:
25+
- uses: actions/checkout@v6
26+
27+
- uses: oven-sh/setup-bun@v2
28+
with:
29+
bun-version: latest
30+
31+
- uses: actions/setup-node@v6
32+
with:
33+
node-version: '22'
34+
35+
- uses: pnpm/action-setup@v4
36+
37+
- run: pnpm install --frozen-lockfile
38+
39+
- name: Patch vitest imports
40+
run: |
41+
for f in test/*.test.ts; do
42+
[ -e "$f" ] || exit 0
43+
sed --version >/dev/null 2>&1 && \
44+
sed -i "s@'vite-plus/test'@'vitest'@g" "$f" || \
45+
sed -i '' "s@'vite-plus/test'@'vitest'@g" "$f"
46+
done
47+
sed --version >/dev/null 2>&1 && \
48+
sed -i "s@'vite-plus'@'vite'@g" vite.config.ts || \
49+
sed -i '' "s@'vite-plus'@'vite'@g" vite.config.ts
50+
jq 'del(.overrides) | del(.pnpm.overrides)' package.json > package.json.tmp && mv package.json.tmp package.json
51+
pnpm install -D vitest@latest vite@latest
52+
53+
- name: Run tests with Bun
54+
run: bun --bun ./node_modules/.bin/vitest run --reporter=dot

0 commit comments

Comments
 (0)