feat(booking-requests): add optional booking-requests module #621
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] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| lint-and-typecheck: | |
| name: Lint & Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build packages | |
| run: pnpm -r --filter @telivityhaip/shared --filter @telivityhaip/database --filter @telivityhaip/booking-requests run build | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Type Check | |
| run: pnpm typecheck | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: haip | |
| POSTGRES_PASSWORD: haip | |
| POSTGRES_DB: haip_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 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build packages | |
| run: pnpm build | |
| - name: Migrate test database | |
| run: pnpm db:migrate | |
| env: | |
| DATABASE_URL: postgresql://haip:haip@localhost:5432/haip_test | |
| - name: Run tests and verify README test counts | |
| run: node scripts/sync-test-count.mjs --check | |
| env: | |
| DATABASE_URL: postgresql://haip:haip@localhost:5432/haip_test | |
| REDIS_URL: redis://localhost:6379 | |
| FORCE_COLOR: '0' | |
| CI: 'true' | |
| release-smoke: | |
| name: Release smoke (PMS contract) | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: haip | |
| POSTGRES_PASSWORD: haip | |
| POSTGRES_DB: haip_smoke | |
| 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 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build packages | |
| run: pnpm build | |
| - name: Run release smoke test | |
| run: pnpm --filter @telivityhaip/api run test:release-smoke | |
| env: | |
| DATABASE_URL: postgresql://haip:haip@localhost:5432/haip_smoke | |
| REDIS_URL: redis://localhost:6379 | |
| RELEASE_SMOKE: '1' | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build all packages | |
| run: pnpm build | |
| demo-smoke: | |
| name: One-command demo smoke test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Exercises the exact path a newcomer follows: `docker compose up`. | |
| # Builds the image, runs the one-shot init (migrate + seed), then the API. | |
| # `up -d` blocks on init's service_completed_successfully, so a failed | |
| # migrate/seed (e.g. schema drift) fails this step immediately. | |
| - name: Build & start the demo (docker compose up) | |
| run: docker compose up -d --build | |
| - name: Wait for the API to become healthy | |
| run: | | |
| for i in $(seq 1 60); do | |
| if curl -fsS http://localhost:3000/api/v1/health | grep -q '"status":"ok"'; then | |
| echo "API healthy after ~$((i * 5))s" | |
| exit 0 | |
| fi | |
| sleep 5 | |
| done | |
| echo "::error::API did not become healthy within 5 minutes" | |
| exit 1 | |
| - name: Verify the dashboard UI is served at the same origin | |
| run: | | |
| body=$(curl -fsS http://localhost:3000/) | |
| if echo "$body" | grep -qi 'id="root"'; then | |
| echo "Dashboard served at / ✓" | |
| else | |
| echo "::error::Dashboard HTML not served at http://localhost:3000/" | |
| echo "$body" | head -20 | |
| exit 1 | |
| fi | |
| - name: Verify Swagger docs are served (informational) | |
| run: | | |
| curl -fsS http://localhost:3000/docs >/dev/null \ | |
| && echo "Swagger served at /docs ✓" \ | |
| || echo "::warning::/docs was not reachable" | |
| - name: Dump compose logs on failure | |
| if: failure() | |
| run: docker compose logs --no-color | |
| - name: Tear down | |
| if: always() | |
| run: docker compose down -v |