Skip to content

Commit 51d2a0d

Browse files
committed
fix startup
1 parent d9f84e4 commit 51d2a0d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/test-python.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defaults:
1414
shell: bash -eux {0}
1515

1616
env:
17-
MONGODB_VERSION: 7.0
17+
MONGODB_VERSION: "7.0"
1818

1919
jobs:
2020
build:
@@ -34,8 +34,8 @@ jobs:
3434
uses: actions/setup-python@v5
3535
with:
3636
python-version: ${{ matrix.python-version }}
37-
- name: Start MongoDB on Linux and Windows
38-
if: ${{ !startsWith(runner.os, 'macOS') }}
37+
- name: Start MongoDB on Linux
38+
if: ${{ startsWith(runner.os, 'Linux') }}
3939
run: |
4040
docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongo:${MONGODB_VERSION} mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5
4141
until docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do
@@ -48,6 +48,14 @@ jobs:
4848
brew tap mongodb/brew
4949
brew install mongodb/brew/mongodb-community@${MONGODB_VERSION}
5050
brew services start mongodb-community@${MONGODB_VERSION}
51+
- name: Start MongoDB on Windows
52+
if: ${{ startsWith(runner.os, 'Windows') }}
53+
shell: powershell
54+
run: |
55+
mkdir data
56+
mongod --remove
57+
mongod --install --dbpath=$(pwd)/data --logpath=$PWD/mongo.log
58+
net start MongoDB
5159
- name: Install package and pytest
5260
run: |
5361
python -m pip install .

0 commit comments

Comments
 (0)