Skip to content

Commit b565175

Browse files
committed
fix(ci): ensure prisma client generation and fallback test env vars are set
1 parent 161d25f commit b565175

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ jobs:
6161
- name: Install backend dependencies
6262
run: npm --prefix apps/backend install
6363

64+
- name: Generate Prisma Client
65+
run: cd apps/backend && npx prisma generate
66+
6467
- name: Backend lint
6568
id: backend_lint
6669
continue-on-error: true

apps/backend/src/app.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ export async function buildApp():Promise<FastifyInstance> {
2929
// Validate all required secrets before registering any plugin.
3030
// If validation fails the process exits here — no partially-initialised
3131
// auth state can exist because Fastify is not yet instantiated.
32+
if (process.env.NODE_ENV === 'test') {
33+
process.env.JWT_SECRET = process.env.JWT_SECRET || 'test-jwt-secret-that-is-sufficiently-long-and-secure';
34+
process.env.ENCRYPTION_KEY = process.env.ENCRYPTION_KEY || 'test-encryption-key-for-testing-purposes-32-chars';
35+
}
3236
validateEnv();
3337

3438
const app = Fastify({

0 commit comments

Comments
 (0)