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
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
| Version | 8.0 | 7.0 |
|---|---|---|
ubuntu-24.04 | default | |
ubuntu-24.04-arm | default | |
ubuntu-22.04 | default | ✓ |
ubuntu-22.04-arm | default | ✓ |
macos-26 | default | ✓ |
macos-15 | default | ✓ |
macos-15-intel | default | ✓ |
macos-14 | default | ✓ |
windows-2025 | default | |
windows-2022 | default |
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()"
Related Actions
Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features