Skip to content

feat: add Bun runtime support #1

feat: add Bun runtime support

feat: add Bun runtime support #1

Workflow file for this run

name: Bun CI
on:
push:
branches: [master]
pull_request:
branches: [master]
merge_group:
jobs:
test:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest']
name: Test (Bun, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
concurrency:
group: bun-${{ github.workflow }}-#${{ github.event.pull_request.number || github.head_ref || github.ref }}-(${{ matrix.os }})
cancel-in-progress: true
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: actions/setup-node@v6
with:
node-version: '22'
- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile
- name: Patch vitest imports
run: |
for f in test/*.test.ts; do
[ -e "$f" ] || exit 0
sed --version >/dev/null 2>&1 && \
sed -i "s@'vite-plus/test'@'vitest'@g" "$f" || \
sed -i '' "s@'vite-plus/test'@'vitest'@g" "$f"
done
sed --version >/dev/null 2>&1 && \
sed -i "s@'vite-plus'@'vite'@g" vite.config.ts || \
sed -i '' "s@'vite-plus'@'vite'@g" vite.config.ts
jq 'del(.overrides) | del(.pnpm.overrides)' package.json > package.json.tmp && mv package.json.tmp package.json
pnpm install -D vitest@latest vite@latest
- name: Run tests with Bun
run: bun --bun ./node_modules/.bin/vitest run --reporter=dot