Add MongoDB Service Configuration to CI Workflows
- Added a MongoDB service to both `pr-test.yml` and `unit-test.yml` workflows to support database testing. - Configured MongoDB with necessary environment variables for root credentials and database name, improving the test environment setup.
This commit is contained in:
parent
70bed98e06
commit
1df58d576a
2 changed files with 18 additions and 0 deletions
9
.github/workflows/pr-test.yml
vendored
9
.github/workflows/pr-test.yml
vendored
|
|
@ -357,6 +357,15 @@ jobs:
|
|||
- "3021:3021"
|
||||
- "3022:3022"
|
||||
|
||||
mongodb:
|
||||
image: mongo:6.0
|
||||
ports:
|
||||
- 27017:27017
|
||||
env:
|
||||
MONGO_INITDB_ROOT_USERNAME: root
|
||||
MONGO_INITDB_ROOT_PASSWORD: 123456
|
||||
MONGO_INITDB_DATABASE: test
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.24]
|
||||
|
|
|
|||
9
.github/workflows/unit-test.yml
vendored
9
.github/workflows/unit-test.yml
vendored
|
|
@ -302,6 +302,15 @@ jobs:
|
|||
- "3021:3021"
|
||||
- "3022:3022"
|
||||
|
||||
mongodb:
|
||||
image: mongo:6.0
|
||||
ports:
|
||||
- 27017:27017
|
||||
env:
|
||||
MONGO_INITDB_ROOT_USERNAME: root
|
||||
MONGO_INITDB_ROOT_PASSWORD: 123456
|
||||
MONGO_INITDB_DATABASE: test
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.24]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue