From ac057f673d6f94b7fc7fffacad407f0479ce6ed5 Mon Sep 17 00:00:00 2001 From: Josef Erben Date: Fri, 20 Sep 2024 21:30:20 +0200 Subject: [PATCH] fix(ci): health check --- .github/workflows/ci.yml | 9 ++++++--- package.json | 2 +- pnpm-lock.yaml | 12 +++++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d89e80..687ef81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,11 +50,14 @@ jobs: - name: 200 ok ✅ run: | pnpm dev & - sleep 10 # Wait for the server to start - if curl -s http://localhost:3000 | grep -q "{\"status\":\"ok\"}"; then - echo "Server started successfully and contains 'Let's go'" + sleep 5 # wait for the server to start + response=$(curl -s http://localhost:3000/health) + if echo "$response" | grep -q '{"status":"ok"}'; then + echo "Server started and healthy" + echo "Response: $response" else echo "Server check failed" + echo "Unexpected response: $response" exit 1 fi kill $! # Stop the server diff --git a/package.json b/package.json index 7c45292..8104a69 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "express": "^4.19.2", "htmx.org": "^1.9.12", "kysely": "^0.27.4", - "plainstack": "^0.0.18", + "plainstack": "^0.0.19", "tsx": "^4.16.2", "zod": "^3.23.8" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d2da1f1..ab604a6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,8 +33,8 @@ importers: specifier: ^0.27.4 version: 0.27.4 plainstack: - specifier: ^0.0.18 - version: 0.0.18(@kitajs/html@4.2.2)(better-sqlite3@11.3.0)(esbuild@0.23.1)(express@4.21.0)(kysely-codegen@0.16.8(better-sqlite3@11.3.0)(kysely@0.27.4))(kysely@0.27.4)(tailwindcss@3.4.12)(tsx@4.19.1)(typescript@5.6.2)(vitest@2.1.1(@types/node@20.16.5)) + specifier: ^0.0.19 + version: 0.0.19(@kitajs/html@4.2.2)(better-sqlite3@11.3.0)(esbuild@0.23.1)(express@4.21.0)(kysely-codegen@0.16.8(better-sqlite3@11.3.0)(kysely@0.27.4))(kysely@0.27.4)(tailwindcss@3.4.12)(tsx@4.19.1)(typescript@5.6.2)(vitest@2.1.1(@types/node@20.16.5))(zod@3.23.8) tsx: specifier: ^4.16.2 version: 4.19.1 @@ -1568,8 +1568,8 @@ packages: peerDependencies: better-sqlite3: ^11.0.0 - plainstack@0.0.18: - resolution: {integrity: sha512-GJ9iF3L3KXF99NbhepF5vGJScTSQ86FNsNY+zdKlL/OkoErgr7L9bzOm0YRELE5DKPeC7c0bbS3W7v3pVnmeNg==} + plainstack@0.0.19: + resolution: {integrity: sha512-le0UxI8udRRK9H5ndqfZXIqfGRa5fRLQ/9IPuSYcubVDALzo60QPsjItp7ObO7J9GPmsWKuyiBnxcONhcVmBZQ==} hasBin: true peerDependencies: '@kitajs/html': ^4.2.1 @@ -1581,6 +1581,7 @@ packages: tsx: ^4.16.2 typescript: ^5.3.3 vitest: ^2.0.1 + zod: ^3.23.8 pluralize@8.0.0: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} @@ -3359,7 +3360,7 @@ snapshots: better-sqlite3: 11.3.0 cron-parser: 4.9.0 - plainstack@0.0.18(@kitajs/html@4.2.2)(better-sqlite3@11.3.0)(esbuild@0.23.1)(express@4.21.0)(kysely-codegen@0.16.8(better-sqlite3@11.3.0)(kysely@0.27.4))(kysely@0.27.4)(tailwindcss@3.4.12)(tsx@4.19.1)(typescript@5.6.2)(vitest@2.1.1(@types/node@20.16.5)): + plainstack@0.0.19(@kitajs/html@4.2.2)(better-sqlite3@11.3.0)(esbuild@0.23.1)(express@4.21.0)(kysely-codegen@0.16.8(better-sqlite3@11.3.0)(kysely@0.27.4))(kysely@0.27.4)(tailwindcss@3.4.12)(tsx@4.19.1)(typescript@5.6.2)(vitest@2.1.1(@types/node@20.16.5))(zod@3.23.8): dependencies: '@kitajs/html': 4.2.2 '@paralleldrive/cuid2': 2.2.2 @@ -3384,6 +3385,7 @@ snapshots: tsx: 4.19.1 typescript: 5.6.2 vitest: 2.1.1(@types/node@20.16.5) + zod: 3.23.8 transitivePeerDependencies: - better-sqlite3 - kysely-postgres-js