feat: implement revolutionary auto-generation system for Live Compone… #52
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: 🚀 FluxStack v1.4.0 - Complete Build & Test Suite | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| workflow_dispatch: # Allow manual triggering | |
| env: | |
| BUN_VERSION: '1.1.34' | |
| NODE_VERSION: '20' | |
| jobs: | |
| # 📦 Test unified dependency installation | |
| installation-test: | |
| name: 📦 Monorepo Installation Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: 🚀 Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: 📊 Test installation performance | |
| run: | | |
| echo "⏱️ Testing monorepo unified installation..." | |
| time_start=$(date +%s) | |
| bun install | |
| time_end=$(date +%s) | |
| duration=$((time_end - time_start)) | |
| echo "✅ Installation completed in ${duration}s" | |
| # Verify single node_modules | |
| if [ -d "node_modules" ] && [ ! -d "app/client/node_modules" ]; then | |
| echo "✅ Unified node_modules structure confirmed" | |
| else | |
| echo "❌ Monorepo structure validation failed" | |
| exit 1 | |
| fi | |
| - name: 📋 Verify dependencies availability | |
| run: | | |
| echo "🔍 Checking if libraries are available for both frontend and backend..." | |
| # Check React (frontend) | |
| if bun pm ls | grep -q "react@"; then | |
| echo "✅ React available for frontend" | |
| else | |
| echo "❌ React missing" | |
| exit 1 | |
| fi | |
| # Check Elysia (backend) | |
| if bun pm ls | grep -q "elysia@"; then | |
| echo "✅ Elysia available for backend" | |
| else | |
| echo "❌ Elysia missing" | |
| exit 1 | |
| fi | |
| # Check shared dependencies | |
| if bun pm ls | grep -q "typescript@"; then | |
| echo "✅ TypeScript available for both" | |
| else | |
| echo "❌ TypeScript missing" | |
| exit 1 | |
| fi | |
| # 🧪 Run all 30 tests | |
| test-suite: | |
| name: 🧪 Complete Test Suite (30 Tests) | |
| runs-on: ubuntu-latest | |
| needs: installation-test | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: 🚀 Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: 📦 Install dependencies | |
| run: bun install | |
| - name: 🧪 Run all tests | |
| run: | | |
| echo "🔬 Running complete test suite..." | |
| bun run test:run | |
| - name: 📊 Generate test coverage | |
| run: | | |
| echo "📈 Generating test coverage report..." | |
| bun run test:coverage | |
| - name: 📋 Upload coverage reports | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| fail_ci_if_error: false | |
| # 🎨 Frontend build isolation test | |
| frontend-build-test: | |
| name: 🎨 Frontend Build Isolation | |
| runs-on: ubuntu-latest | |
| needs: installation-test | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: 🚀 Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: 📦 Install dependencies | |
| run: bun install | |
| - name: 🎨 Build frontend only | |
| run: | | |
| echo "🏗️ Testing isolated frontend build..." | |
| bun run build:frontend | |
| - name: ✅ Verify frontend build artifacts | |
| run: | | |
| echo "🔍 Checking frontend build output..." | |
| if [ -d "dist/client" ]; then | |
| echo "✅ Frontend dist directory created" | |
| else | |
| echo "❌ Frontend dist directory missing" | |
| exit 1 | |
| fi | |
| if [ -f "dist/client/index.html" ]; then | |
| echo "✅ Frontend index.html generated" | |
| else | |
| echo "❌ Frontend index.html missing" | |
| exit 1 | |
| fi | |
| if [ -d "dist/client/assets" ]; then | |
| echo "✅ Frontend assets directory created" | |
| echo "📋 Assets found:" | |
| ls -la dist/client/assets/ | |
| else | |
| echo "❌ Frontend assets directory missing" | |
| exit 1 | |
| fi | |
| - name: 📏 Check bundle size | |
| run: | | |
| echo "📊 Frontend bundle analysis:" | |
| du -sh dist/client/ | |
| echo "📋 Asset breakdown:" | |
| find dist/client/assets -name "*.js" -exec ls -lh {} \; | |
| find dist/client/assets -name "*.css" -exec ls -lh {} \; | |
| # ⚡ Backend build isolation test | |
| backend-build-test: | |
| name: ⚡ Backend Build Isolation | |
| runs-on: ubuntu-latest | |
| needs: installation-test | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: 🚀 Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: 📦 Install dependencies | |
| run: bun install | |
| - name: ⚡ Build backend only | |
| run: | | |
| echo "🏗️ Testing isolated backend build..." | |
| bun run build:backend | |
| - name: ✅ Verify backend build artifacts | |
| run: | | |
| echo "🔍 Checking backend build output..." | |
| if [ -f "dist/index.js" ]; then | |
| echo "✅ Backend bundle created" | |
| ls -lh dist/index.js | |
| else | |
| echo "❌ Backend bundle missing" | |
| exit 1 | |
| fi | |
| - name: 🧪 Test backend bundle execution | |
| run: | | |
| echo "🚀 Testing backend bundle execution..." | |
| timeout 10s bun dist/index.js || true | |
| echo "✅ Backend bundle executable" | |
| # 🚀 Full-stack unified build test | |
| fullstack-build-test: | |
| name: 🚀 Full-Stack Unified Build | |
| runs-on: ubuntu-latest | |
| needs: installation-test | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: 🚀 Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: 📦 Install dependencies | |
| run: bun install | |
| - name: 🏗️ Full unified build | |
| run: | | |
| echo "🔧 Testing unified full-stack build..." | |
| bun run build | |
| - name: ✅ Verify complete build artifacts | |
| run: | | |
| echo "🔍 Checking complete build output..." | |
| # Check frontend artifacts | |
| if [ -d "dist/client" ] && [ -f "dist/client/index.html" ]; then | |
| echo "✅ Frontend build completed" | |
| else | |
| echo "❌ Frontend build incomplete" | |
| exit 1 | |
| fi | |
| # Check backend artifacts | |
| if [ -f "dist/index.js" ]; then | |
| echo "✅ Backend build completed" | |
| else | |
| echo "❌ Backend build incomplete" | |
| exit 1 | |
| fi | |
| echo "📊 Complete build size:" | |
| du -sh dist/ | |
| - name: 🚀 Test production server simulation | |
| run: | | |
| echo "🌐 Testing production server startup..." | |
| timeout 15s bun run start & | |
| sleep 5 | |
| # Test API endpoint | |
| if curl -f http://localhost:3000/api/health; then | |
| echo "✅ Production server API responding" | |
| else | |
| echo "❌ Production server API not responding" | |
| exit 1 | |
| fi | |
| # 🔧 Development mode tests | |
| development-mode-test: | |
| name: 🔧 Development Modes Test | |
| runs-on: ubuntu-latest | |
| needs: installation-test | |
| strategy: | |
| matrix: | |
| mode: [frontend, backend] | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: 🚀 Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: 📦 Install dependencies | |
| run: bun install | |
| - name: 🔧 Test ${{ matrix.mode }} development mode | |
| run: | | |
| echo "🚀 Testing ${{ matrix.mode }} development mode..." | |
| if [ "${{ matrix.mode }}" == "frontend" ]; then | |
| timeout 30s bun run dev:frontend & | |
| sleep 10 | |
| if curl -f http://localhost:5173; then | |
| echo "✅ Frontend dev server responding" | |
| else | |
| echo "❌ Frontend dev server not responding" | |
| exit 1 | |
| fi | |
| fi | |
| if [ "${{ matrix.mode }}" == "backend" ]; then | |
| timeout 30s bun run dev:backend & | |
| sleep 10 | |
| if curl -f http://localhost:3001/api/health; then | |
| echo "✅ Backend dev server responding" | |
| else | |
| echo "❌ Backend dev server not responding" | |
| exit 1 | |
| fi | |
| fi | |
| # 🐳 Docker build tests | |
| docker-build-test: | |
| name: 🐳 Docker Build Test | |
| runs-on: ubuntu-latest | |
| needs: [frontend-build-test, backend-build-test] | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: 🐳 Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: 🏗️ Build Docker image | |
| run: | | |
| echo "🐳 Building FluxStack Docker image..." | |
| docker build -t fluxstack:test . | |
| - name: 🧪 Test Docker container | |
| run: | | |
| echo "🚀 Testing Docker container..." | |
| docker run -d -p 3000:3000 --name fluxstack-test fluxstack:test | |
| sleep 10 | |
| if curl -f http://localhost:3000/api/health; then | |
| echo "✅ Docker container API responding" | |
| else | |
| echo "❌ Docker container API not responding" | |
| exit 1 | |
| fi | |
| docker stop fluxstack-test | |
| # 🔄 Hot reload simulation test | |
| hot-reload-test: | |
| name: 🔄 Hot Reload Independence Test | |
| runs-on: ubuntu-latest | |
| needs: installation-test | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: 🚀 Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: 📦 Install dependencies | |
| run: bun install | |
| - name: 🔥 Test hot reload independence | |
| run: | | |
| echo "🔄 Testing hot reload independence..." | |
| # Start full-stack dev mode | |
| timeout 60s bun run dev & | |
| DEV_PID=$! | |
| sleep 15 | |
| # Verify both servers are running | |
| if curl -f http://localhost:3000/api/health && curl -f http://localhost:5173; then | |
| echo "✅ Both frontend and backend started successfully" | |
| else | |
| echo "❌ Development servers failed to start" | |
| kill $DEV_PID 2>/dev/null || true | |
| exit 1 | |
| fi | |
| kill $DEV_PID 2>/dev/null || true | |
| # 📊 Performance benchmarks | |
| performance-test: | |
| name: 📊 Performance Benchmarks | |
| runs-on: ubuntu-latest | |
| needs: installation-test | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: 🚀 Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: ⏱️ Benchmark installation speed | |
| run: | | |
| echo "⚡ Benchmarking installation performance..." | |
| rm -rf node_modules bun.lockb | |
| time_start=$(date +%s%3N) | |
| bun install | |
| time_end=$(date +%s%3N) | |
| duration=$((time_end - time_start)) | |
| echo "📊 Installation completed in ${duration}ms" | |
| echo "🎯 Target: <15000ms (15s)" | |
| if [ $duration -lt 15000 ]; then | |
| echo "✅ Installation performance acceptable" | |
| else | |
| echo "⚠️ Installation slower than expected" | |
| fi | |
| - name: ⏱️ Benchmark build performance | |
| run: | | |
| echo "🏗️ Benchmarking build performance..." | |
| # Frontend build benchmark | |
| time_start=$(date +%s%3N) | |
| bun run build:frontend | |
| time_end=$(date +%s%3N) | |
| frontend_duration=$((time_end - time_start)) | |
| echo "🎨 Frontend build: ${frontend_duration}ms" | |
| # Backend build benchmark | |
| time_start=$(date +%s%3N) | |
| bun run build:backend | |
| time_end=$(date +%s%3N) | |
| backend_duration=$((time_end - time_start)) | |
| echo "⚡ Backend build: ${backend_duration}ms" | |
| # Total unified build | |
| time_start=$(date +%s%3N) | |
| bun run build | |
| time_end=$(date +%s%3N) | |
| total_duration=$((time_end - time_start)) | |
| echo "🚀 Total build: ${total_duration}ms" | |
| # ✅ Summary job | |
| build-summary: | |
| name: ✅ Build Test Summary | |
| runs-on: ubuntu-latest | |
| needs: [ | |
| installation-test, | |
| test-suite, | |
| frontend-build-test, | |
| backend-build-test, | |
| fullstack-build-test, | |
| development-mode-test, | |
| docker-build-test, | |
| hot-reload-test, | |
| performance-test | |
| ] | |
| if: always() | |
| steps: | |
| - name: 📋 Build Summary | |
| run: | | |
| echo "🎉 FluxStack v1.4.0 Build Test Summary" | |
| echo "==================================" | |
| echo "✅ Monorepo installation: ${{ needs.installation-test.result }}" | |
| echo "✅ Complete test suite (30 tests): ${{ needs.test-suite.result }}" | |
| echo "✅ Frontend build isolation: ${{ needs.frontend-build-test.result }}" | |
| echo "✅ Backend build isolation: ${{ needs.backend-build-test.result }}" | |
| echo "✅ Full-stack unified build: ${{ needs.fullstack-build-test.result }}" | |
| echo "✅ Development modes: ${{ needs.development-mode-test.result }}" | |
| echo "✅ Docker containerization: ${{ needs.docker-build-test.result }}" | |
| echo "✅ Hot reload independence: ${{ needs.hot-reload-test.result }}" | |
| echo "✅ Performance benchmarks: ${{ needs.performance-test.result }}" | |
| echo "" | |
| echo "🚀 FluxStack v1.4.0 monorepo architecture validated!" | |
| - name: ❌ Fail if any test failed | |
| if: | | |
| needs.installation-test.result == 'failure' || | |
| needs.test-suite.result == 'failure' || | |
| needs.frontend-build-test.result == 'failure' || | |
| needs.backend-build-test.result == 'failure' || | |
| needs.fullstack-build-test.result == 'failure' || | |
| needs.development-mode-test.result == 'failure' || | |
| needs.docker-build-test.result == 'failure' || | |
| needs.hot-reload-test.result == 'failure' || | |
| needs.performance-test.result == 'failure' | |
| run: | | |
| echo "❌ Some tests failed - check individual job results" | |
| exit 1 |