setup-mongodb

December 7, 2025 · View on GitHub

The missing action for MongoDB :tada:

  • Faster (with the default version) and simpler than containers
  • Works on Linux, Mac, and Windows
  • Supports different versions

Build Status

Getting Started

Add it as a step to your workflow

      - uses: ankane/setup-mongodb@v1

Versions

Specify a version

      - uses: ankane/setup-mongodb@v1
        with:
          mongodb-version: 8.0

Currently supports

Version8.07.0
ubuntu-24.04default
ubuntu-24.04-armdefault
ubuntu-22.04default
ubuntu-22.04-armdefault
macos-26default
macos-15default
macos-15-inteldefault
macos-14default
windows-2025default
windows-2022default

Test against multiple versions

    strategy:
      matrix:
        mongodb-version: [8.0, 7.0]
    steps:
      - uses: ankane/setup-mongodb@v1
        with:
          mongodb-version: ${{ matrix.mongodb-version }}

Extra Steps

Run queries

      - run: mongosh --eval "db.version()"

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help: