Skip to content

Commit abfc0f4

Browse files
authored
Merge pull request #391 from Guddy1-tech/Centralized-Configuration-Management-Service-Setup
Centralized configuration management service setup
2 parents 94b4412 + a19ee4d commit abfc0f4

60 files changed

Lines changed: 15137 additions & 44 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-cd.yml

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ on:
77
branches: [main, develop]
88

99
env:
10-
NODE_VERSION: '18.x'
10+
NODE_VERSION: '20.x'
1111
POSTGRES_VERSION: '14'
1212

13+
defaults:
14+
run:
15+
working-directory: microservices/config-service
16+
1317
jobs:
1418
# Code Quality Checks
1519
lint-and-format:
@@ -25,6 +29,7 @@ jobs:
2529
with:
2630
node-version: ${{ env.NODE_VERSION }}
2731
cache: 'npm'
32+
cache-dependency-path: microservices/config-service/package-lock.json
2833

2934
- name: 📋 Install dependencies
3035
run: npm ci
@@ -52,9 +57,13 @@ jobs:
5257
with:
5358
node-version: ${{ env.NODE_VERSION }}
5459
cache: 'npm'
60+
cache-dependency-path: microservices/config-service/package-lock.json
61+
62+
- name: 📋 Install dependencies
63+
run: npm ci
5564

5665
- name: 🔐 Run security audit
57-
run: npm audit --audit-level=moderate
66+
run: npm audit --omit=dev --audit-level=moderate
5867

5968
- name: 🛡️ Run dependency vulnerability scan
6069
run: |
@@ -68,7 +77,7 @@ jobs:
6877

6978
strategy:
7079
matrix:
71-
node-version: ['16.x', '18.x', '20.x']
80+
node-version: ['20.x', '22.x']
7281

7382
steps:
7483
- name: 📥 Checkout code
@@ -79,6 +88,7 @@ jobs:
7988
with:
8089
node-version: ${{ matrix.node-version }}
8190
cache: 'npm'
91+
cache-dependency-path: microservices/config-service/package-lock.json
8292

8393
- name: 📋 Install dependencies
8494
run: npm ci
@@ -137,31 +147,21 @@ jobs:
137147
with:
138148
node-version: ${{ env.NODE_VERSION }}
139149
cache: 'npm'
150+
cache-dependency-path: microservices/config-service/package-lock.json
140151

141152
- name: 📋 Install dependencies
142153
run: npm ci
143154

144-
- name: 🗄️ Run database migrations
145-
run: npm run migration:run
146-
env:
147-
DATABASE_HOST: localhost
148-
DATABASE_PORT: 5432
149-
DATABASE_USER: test_user
150-
DATABASE_PASSWORD: test_password
151-
DATABASE_NAME: quest_service_test
152-
153155
- name: 🔗 Run integration tests
154-
run: npm run test:integration
156+
run: npm run test:e2e -- --runInBand
155157
env:
156158
NODE_ENV: test
157-
DATABASE_HOST: localhost
158-
DATABASE_PORT: 5432
159-
DATABASE_USER: test_user
160-
DATABASE_PASSWORD: test_password
161-
DATABASE_NAME: quest_service_test
162-
REDIS_HOST: localhost
163-
REDIS_PORT: 6379
164-
JWT_SECRET: test-jwt-secret-key-for-ci
159+
DB_HOST: localhost
160+
DB_PORT: 5432
161+
DB_USER: test_user
162+
DB_PASSWORD: test_password
163+
DB_NAME: quest_service_test
164+
ENCRYPTION_KEY: test-encryption-key-at-least-32-characters
165165

166166
- name: 📊 Upload integration test coverage
167167
uses: codecov/codecov-action@v3
@@ -209,39 +209,27 @@ jobs:
209209
with:
210210
node-version: ${{ env.NODE_VERSION }}
211211
cache: 'npm'
212+
cache-dependency-path: microservices/config-service/package-lock.json
212213

213214
- name: 📋 Install dependencies
214215
run: npm ci
215216

216217
- name: 🏗️ Build application
217218
run: npm run build
218219

219-
- name: 🗄️ Setup test database
220-
run: |
221-
npm run migration:run
222-
npm run seed:run
223-
env:
224-
DATABASE_HOST: localhost
225-
DATABASE_PORT: 5432
226-
DATABASE_USER: test_user
227-
DATABASE_PASSWORD: test_password
228-
DATABASE_NAME: quest_service_e2e
229-
230220
- name: 🎭 Run E2E tests
231-
run: npm run test:e2e
221+
run: npm run test:e2e -- --runInBand
232222
env:
233223
NODE_ENV: test
234-
DATABASE_HOST: localhost
235-
DATABASE_PORT: 5432
236-
DATABASE_USER: test_user
237-
DATABASE_PASSWORD: test_password
238-
DATABASE_NAME: quest_service_e2e
239-
REDIS_HOST: localhost
240-
REDIS_PORT: 6379
241-
JWT_SECRET: test-jwt-secret-key-for-e2e
224+
DB_HOST: localhost
225+
DB_PORT: 5432
226+
DB_USER: test_user
227+
DB_PASSWORD: test_password
228+
DB_NAME: quest_service_e2e
229+
ENCRYPTION_KEY: test-encryption-key-at-least-32-characters
242230

243231
- name: 📸 Upload E2E test artifacts
244-
uses: actions/upload-artifact@v3
232+
uses: actions/upload-artifact@v4
245233
if: failure()
246234
with:
247235
name: e2e-test-results
@@ -280,6 +268,7 @@ jobs:
280268
with:
281269
node-version: ${{ env.NODE_VERSION }}
282270
cache: 'npm'
271+
cache-dependency-path: microservices/config-service/package-lock.json
283272

284273
- name: 📋 Install dependencies
285274
run: npm ci
@@ -343,7 +332,7 @@ jobs:
343332
- name: 🏗️ Build and push Docker image
344333
uses: docker/build-push-action@v5
345334
with:
346-
context: .
335+
context: microservices/config-service
347336
platforms: linux/amd64,linux/arm64
348337
push: true
349338
tags: ${{ steps.meta.outputs.tags }}

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
jobs:
1010
build-and-test:
1111
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: microservices/config-service
1215

1316
steps:
1417
- name: Checkout Code
@@ -19,6 +22,7 @@ jobs:
1922
with:
2023
node-version: '20'
2124
cache: 'npm'
25+
cache-dependency-path: microservices/config-service/package-lock.json
2226

2327
- name: Install Dependencies
2428
run: npm ci
@@ -30,7 +34,7 @@ jobs:
3034
run: npm run format:check
3135

3236
- name: TypeScript Type Check
33-
run: npm run typecheck
37+
run: npm run type-check
3438

3539
- name: Run Unit Tests
3640
run: npm test

0 commit comments

Comments
 (0)