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:
Max 2025-12-15 11:31:49 +08:00
parent 70bed98e06
commit 1df58d576a
2 changed files with 18 additions and 0 deletions

View file

@ -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]

View file

@ -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]