docs: add bun create invocation
#29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| check: | |
| name: Typecheck, Test & Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| # Pin bun version for reproducible builds. Update periodically. | |
| bun-version: "1.3.10" | |
| # Cache bun dependencies | |
| - name: Cache bun modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }} | |
| restore-keys: bun-${{ runner.os }}- | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Typecheck | |
| run: bun run typecheck | |
| - name: Typecheck tests | |
| run: tsc --noEmit -p tsconfig.test.json | |
| - name: Test | |
| run: bun run test --run | |
| - name: Build | |
| run: bun run build | |
| - name: Get Playwright version | |
| id: pw-version | |
| run: echo "version=$(bunx playwright --version)" >> "$GITHUB_OUTPUT" | |
| # Cache Playwright browsers separately (large, changes rarely) | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v4 | |
| id: playwright-cache | |
| with: | |
| path: ~/.cache/ms-playwright | |
| # Key on Playwright version only — avoids invalidating ~400MB browser cache on unrelated dep changes | |
| key: playwright-${{ runner.os }}-${{ steps.pw-version.outputs.version }} | |
| - name: Install Playwright browsers | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: bunx playwright install --with-deps chromium | |
| # Still need system deps even on cache hit | |
| - name: Install Playwright system deps | |
| if: steps.playwright-cache.outputs.cache-hit == 'true' | |
| run: bunx playwright install-deps chromium | |
| - name: E2E tests | |
| run: bun run test:e2e |