diff --git a/.github/workflows/tests/mongo-test.yaml b/.github/workflows/tests/mongo-test.yaml new file mode 100644 index 0000000..12025c1 --- /dev/null +++ b/.github/workflows/tests/mongo-test.yaml @@ -0,0 +1,46 @@ +name: MongoDB Replica Set Unit Tests + +on: [push, pull_request] + +jobs: + mongo-test: + runs-on: ubuntu-latest + services: + mongodb: + image: mongo:latest + ports: + - 27017:27017 + options: >- + --replSet rs0 + env: + MONGO_INITDB_ROOT_USERNAME: olake + MONGO_INITDB_ROOT_PASSWORD: olake + # Wait for MongoDB to be ready + options: >- + --replSet rs0 + # Initialize the replica set + run: | + sleep 10 + mongo --host localhost:27017 <