Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ jobs:
working-directory: server

env:
NODE_ENV: test
PORT: 5000
DATABASE_URL: postgresql://test:test@localhost:5432/testdb
JWT_SECRET: github-actions-secret
NODE_ENV: test
DATABASE_URL: postgres://test:test@localhost:5432/testdb
JWT_SECRET: test-secret

AZURE_AI_KEY: dummy-key
AZURE_AI_ENDPOINT: https://dummy.cognitiveservices.azure.com
AZURE_AI_REGION: centralindia
GEMINI_API_KEY: dummy-gemini-key

steps:
- name: Checkout Repository
Expand All @@ -39,14 +44,11 @@ jobs:
- name: Install Dependencies
run: npm ci

- name: TypeScript Build
- name: Run TypeScript Build
run: npm run build

- name: Unit Tests
- name: Run Unit Tests
run: npm run test:unit

- name: Integration Tests
run: npm run test:integration

- name: Coverage Report
run: npm run test:coverage
- name: Run Integration Tests
run: npm run test:integration
29 changes: 14 additions & 15 deletions server/src/config/validateEnv.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
if (process.env.NODE_ENV !== "test") {
const requiredEnvVariables = [
"PORT",
"NODE_ENV",
"DATABASE_URL",
"JWT_SECRET",
];
const requiredEnvVariables = [
"PORT",
"NODE_ENV",
"DATABASE_URL",
"JWT_SECRET",
];

requiredEnvVariables.forEach((envVariable) => {
if (!process.env[envVariable]) {
throw new Error(
`Missing required environment variable: ${envVariable}`
);
}
});

requiredEnvVariables.forEach((envVariable) => {
if (!process.env[envVariable]) {
throw new Error(
`Missing required environment variable: ${envVariable}`
);
}
});
}
Loading
Loading