feat: migrate from npm to Bun #3487
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 | |
| - next | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| DO_NOT_TRACK: 1 | |
| NODE_ENV: development | |
| NODE_VERSION: 20 | |
| BUN_VERSION: 1.2.6 | |
| jobs: | |
| # Single install job that caches node_modules for all other jobs | |
| install: | |
| name: Install Dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Cache node_modules | |
| id: cache-node-modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: node-modules-${{ runner.os }}-bun${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }} | |
| - name: Install dependencies | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| run: bun install | |
| timeout-minutes: 5 | |
| # Fast checks that can run in parallel | |
| format-check: | |
| name: Format Check | |
| runs-on: ubuntu-latest | |
| needs: install | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Restore node_modules cache | |
| id: cache-node-modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: node-modules-${{ runner.os }}-bun${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }} | |
| - name: Install dependencies | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| run: bun install | |
| timeout-minutes: 5 | |
| - name: Format Check | |
| run: bun run format-check | |
| env: | |
| FORCE_COLOR: 1 | |
| changeset-validation: | |
| name: Validate Changesets | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: dorny/paths-filter@v3 | |
| id: changes | |
| with: | |
| filters: | | |
| changesets: | |
| - '.changeset/**' | |
| - '.github/scripts/validate-changesets.mjs' | |
| - uses: actions/setup-node@v4 | |
| if: steps.changes.outputs.changesets == 'true' | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Validate changeset package references | |
| if: steps.changes.outputs.changesets == 'true' | |
| run: | | |
| # Validate that changesets only reference public packages | |
| # This catches issues like using @tm/cli instead of task-master-ai | |
| node .github/scripts/validate-changesets.mjs | |
| env: | |
| FORCE_COLOR: 1 | |
| typecheck: | |
| name: Typecheck | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| needs: install | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Restore node_modules cache | |
| id: cache-node-modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: node-modules-${{ runner.os }}-bun${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }} | |
| - name: Install dependencies | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| run: bun install | |
| timeout-minutes: 5 | |
| - name: Typecheck | |
| run: bun run turbo:typecheck | |
| env: | |
| FORCE_COLOR: 1 | |
| # Build job to ensure everything compiles | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: install | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Restore node_modules cache | |
| id: cache-node-modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: node-modules-${{ runner.os }}-bun${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }} | |
| - name: Install dependencies | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| run: bun install | |
| timeout-minutes: 5 | |
| - name: Build | |
| run: bun run turbo:build | |
| env: | |
| NODE_ENV: production | |
| FORCE_COLOR: 1 | |
| TM_PUBLIC_BASE_DOMAIN: ${{ secrets.TM_PUBLIC_BASE_DOMAIN }} | |
| TM_PUBLIC_SUPABASE_URL: ${{ secrets.TM_PUBLIC_SUPABASE_URL }} | |
| TM_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.TM_PUBLIC_SUPABASE_ANON_KEY }} | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| path: dist/ | |
| retention-days: 1 | |
| test: | |
| name: Test | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| needs: [format-check, typecheck, build, changeset-validation] | |
| if: always() && !cancelled() && !contains(needs.*.result, 'failure') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Restore node_modules cache | |
| id: cache-node-modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: node-modules-${{ runner.os }}-bun${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }} | |
| - name: Install dependencies | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| run: bun install | |
| timeout-minutes: 5 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| path: dist/ | |
| - name: Run Tests | |
| run: bun run turbo:test | |
| env: | |
| NODE_ENV: test | |
| CI: true | |
| FORCE_COLOR: 1 | |
| - name: Upload Test Results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: | | |
| test-results | |
| coverage | |
| junit.xml | |
| retention-days: 30 |