Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

MongoCamp Logo

Introduction

This GitHub Action starts a MongoDB server with the default port 27017. You can customize the port using the mongodb-port input.

The version of the MongoDb server must be specified using the mongodb-version input. The used version must exist in the published mongocamp/mongodb Docker hub tags. Default value is latest, other possible choices are 7.0, or 8.0.11.

Usage

name: Run testson: [push]jobs:
build:
runs-on: ubuntu-lateststrategy:
matrix:
mongodb-version: ['4.4.14', '5.0.9']steps:
- name: Git checkoutuses: actions/checkout@v2
- name: Start MongoDBuses: MongoCamp/mongodb-github-action@1.0.0with:
mongodb-version: ${{ matrix.mongodb-version }}
- run: curl http://localhost:27017

Using a Custom MongoDB Port

The following sample starts a MongoDB server on port 4711:

name: Run testson: [push]jobs:
build:
runs-on: ubuntu-lateststrategy:
matrix:
mongodb-version: ['4.4.14', '5.0.9']steps:
- name: Git checkoutuses: actions/checkout@v2
- name: Start MongoDBuses: MongoCamp/mongodb-github-action@1.0.0with:
mongodb-version: ${{ matrix.mongodb-version }}mongodb-port: 4711
- run: curl http://localhost:4711

With a Replica Set

The following sample uses the replica set name your-replica-set:

name: Run testson: [push]jobs:
build:
runs-on: ubuntu-lateststrategy:
matrix:
mongodb-version: ['4.4.14', '5.0.9']steps:
- name: Git checkoutuses: actions/checkout@v2
- name: Start MongoDBuses: MongoCamp/mongodb-github-action@1.0.0with:
mongodb-version: ${{ matrix.mongodb-version }}mongodb-replica-set: your-replica-set
- run: curl http://localhost:27017

With Authentication

The following sample uses the username user and the password your-pwd:

name: Run testson: [push]jobs:
build:
runs-on: ubuntu-lateststrategy:
matrix:
mongodb-version: ['4.4.14', '5.0.9']steps:
- name: Git checkoutuses: actions/checkout@v2
- name: Start MongoDBuses: MongoCamp/mongodb-github-action@1.0.0with:
mongodb-version: ${{ matrix.mongodb-version }}mongodb-username: usermongodb-pwd: your-pwd
- run: curl http://localhost:27017

About

Github Action with MongoDb

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages