Skip to content

Commit c26a616

Browse files
committed
fix: jwt, node env add
1 parent 61d25cb commit c26a616

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: HMS Backend CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
jobs:
1010
build:
@@ -19,6 +19,11 @@ jobs:
1919
image: mongo:6.0
2020
ports:
2121
- 27017:27017
22+
options: >-
23+
--health-cmd "mongosh --eval 'db.runCommand({ ping: 1 })'"
24+
--health-interval 10s
25+
--health-timeout 5s
26+
--health-retries 5
2227
2328
steps:
2429
- name: Checkout repository
@@ -37,7 +42,11 @@ jobs:
3742
run: npm run lint
3843

3944
- name: Run Tests
45+
env:
46+
NODE_ENV: test
47+
JWT_SECRET: testsecret123
48+
MONGO_URI: mongodb://127.0.0.1:27017/hms_test
4049
run: npm test
4150

42-
- name: Build docker image
51+
- name: Build Docker Image
4352
run: docker build -t hms-backend:${{ github.sha }} .

0 commit comments

Comments
 (0)