CognxSafeTrack
Claude Sonnet 4.6
ci: add GitHub Actions workflow β typecheck, tests, build
56d35ea Download .github/workflows/ci.yml from safetrack/edtech: direct link, hf CLI and curl.
- Browser
- Download file 3.88 kB
-
https://huggingface.co/spaces/safetrack/edtech/resolve/main/.github/workflows/ci.yml
- Command line
-
hf download hf://spaces/safetrack/edtech/.github/workflows/ci.yml
-
curl -L -o ci.yml https://huggingface.co/spaces/safetrack/edtech/resolve/main/.github/workflows/ci.yml
3.88 kB
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # βββ TypeScript βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| typecheck: | |
| name: TypeScript | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.15.0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Generate Prisma client | |
| run: pnpm --filter @repo/database generate | |
| - name: Build ai-sdk (needed for downstream tsc) | |
| run: pnpm --filter @repo/ai-sdk build | |
| - name: tsc β api | |
| run: pnpm --filter api exec tsc --noEmit | |
| - name: tsc β whatsapp-worker | |
| run: pnpm --filter whatsapp-worker exec tsc --noEmit | |
| - name: tsc β admin | |
| run: pnpm --filter admin exec tsc --noEmit | |
| # βββ Unit & Integration Tests ββββββββββββββββββββββββββββββββββββββββββββββββ | |
| test: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: ankane/pgvector:latest | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: edtech_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/edtech_test | |
| REDIS_URL: redis://localhost:6379/1 | |
| ADMIN_API_KEY: test-api-key-32-chars-long-at-least-123456 | |
| ENCRYPTION_SECRET: test-encryption-secret-32-chars-long-123456 | |
| JWT_SECRET: test-jwt-secret | |
| NODE_ENV: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.15.0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Generate Prisma client | |
| run: pnpm --filter @repo/database generate | |
| - name: Build ai-sdk | |
| run: pnpm --filter @repo/ai-sdk build | |
| - name: Run database migrations | |
| run: pnpm --filter @repo/database migrate:deploy | |
| - name: Run unit & integration tests | |
| # Exclude AI regression tests β they require real API keys and are slow | |
| run: pnpm --filter api exec vitest run --exclude 'test/regression/**' | |
| # βββ Build βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: [typecheck] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.15.0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Generate Prisma client | |
| run: pnpm --filter @repo/database generate | |
| - name: Build all packages and apps | |
| run: pnpm turbo run build | |