Skip to content

Commit 18685e8

Browse files
committed
try this approach
1 parent 1d702d8 commit 18685e8

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/test-python.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,23 @@ jobs:
2727
- uses: actions/checkout@v4
2828
with:
2929
persist-credentials: false
30+
fetch-tags: true
3031
- name: Setup Python
3132
uses: actions/setup-python@v5
3233
with:
3334
python-version: ${{ matrix.python-version }}
34-
- name: "Create MongoDB Replica Set"
35+
- name: Start MongoDB on Linux and Windows
36+
if: ${{ ! startsWith(runner.os, 'macOS') }}
37+
uses: supercharge/[email protected]
38+
with:
39+
mongodb-version: 8.0
40+
mongodb-replica-set: test-rs
41+
- name: Start MongoDB on MacOS
42+
if: ${{ startsWith(runner.os, 'macOS') }}
3543
run: |
36-
podman run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongo:latest mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5
37-
until podman exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do
38-
sleep 1
39-
done
40-
sudo podman exec --tty mongodb mongosh 127.0.0.1:27017 --eval "rs.initiate({\"_id\":\"rs\",\"members\":[{\"_id\":0,\"host\":\"127.0.0.1:27017\" }]})"
44+
brew tap mongodb/brew
45+
brew install [email protected]
46+
brew services start [email protected]
4147
- name: Install package and pytest
4248
run: |
4349
python -m pip install .

0 commit comments

Comments
 (0)