Skip to content

πŸ”„ CI / CD ​

KitchenAsty uses GitHub Actions for continuous integration. The pipeline is defined in .github/workflows/ci.yml.

πŸ—ΊοΈ Pipeline Overview ​

β”Œβ”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Lint β”‚   β”‚ Unit Tests β”‚   β”‚ Integration Tests β”‚   β”‚  Audit  β”‚
β””β”€β”€β”¬β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   β”‚             β”‚                    β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
              β”Œβ”€β”€β”€β”΄β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚ Build β”‚    β”‚ E2E Testsβ”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸƒ Jobs ​

🧹 Lint ​

  • Installs dependencies
  • Generates Prisma client
  • Runs TypeScript type checking on all packages (shared, server, admin, storefront)

πŸ§ͺ Unit Tests ​

  • Runs shared package tests with Vitest
  • Runs server unit tests (src/__tests__/unit)

πŸ”— Integration Tests ​

  • Runs server integration tests (src/__tests__/integration)

🎭 E2E Tests ​

  • Starts a PostgreSQL service container
  • Pushes schema and seeds the database
  • Installs Playwright + Chromium
  • Runs Playwright E2E tests
  • Uploads test results as an artifact

πŸ” Security Audit ​

  • Runs npm audit at high severity level
  • Non-blocking (uses || true)

πŸ—οΈ Build ​

  • Depends on: Lint, Unit Tests, Integration Tests
  • Builds all packages in order: shared β†’ server β†’ admin β†’ storefront
  • Uploads admin and storefront builds as artifacts

πŸš€ Adding Auto-Deploy ​

To extend the pipeline for automatic deployment, add a deploy job after build:

yaml
deploy:
  name: Deploy
  runs-on: ubuntu-latest
  needs: [build]
  if: github.ref == 'refs/heads/main'
  steps:
    - uses: actions/download-artifact@v4
      with:
        name: admin-dist
        path: admin-dist/
    - uses: actions/download-artifact@v4
      with:
        name: storefront-dist
        path: storefront-dist/
    # Add your deployment steps here:
    # - SSH to server and copy files
    # - Push to container registry and restart
    # - Deploy to cloud platform

πŸ” Environment Variables for CI ​

The E2E job uses these environment variables:

VariableValue
DATABASE_URLPoints to the CI PostgreSQL service
JWT_SECRETtest-secret
CORS_ORIGINShttp://localhost:5173,http://localhost:5174
CItrue