mirror of
https://github.com/eyaltoledano/claude-task-master.git
synced 2026-01-30 06:12:05 +00:00
- Replace tsdown with Bun.build() for bundling - Add bunfig.toml and tests/setup.ts for Bun test config - Update CI to use Bun for install and build - Update all package test scripts to use vitest (Node runtime) - Remove deprecated deps: jest, ts-jest, tsdown, tsx, cross-env - Delete jest.config.js, jest.resolver.cjs, tsdown.config.ts Build: Bun bundler (faster than tsdown/esbuild) Install: Bun package manager (bun.lock) Tests: Vitest on Node (Bun runtime has Zod SSR issues) Distribution: Node-compatible output unchanged Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
245 lines
6.3 KiB
YAML
245 lines
6.3 KiB
YAML
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.lockb') }}
|
|
|
|
- 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.lockb') }}
|
|
|
|
- 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 }}
|
|
cache: "npm"
|
|
|
|
- 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.lockb') }}
|
|
|
|
- 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.lockb') }}
|
|
|
|
- name: Install dependencies
|
|
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
run: bun install
|
|
timeout-minutes: 5
|
|
|
|
- name: Build
|
|
run: bun run 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.lockb') }}
|
|
|
|
- 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
|