@@ -13,9 +13,11 @@ defaults:
13
13
run :
14
14
shell : bash -eux {0}
15
15
16
+ env :
17
+ MONGODB_VERSION : 8.0
18
+
16
19
jobs :
17
20
build :
18
- # supercharge/mongodb-github-action requires containers so we don't test other platforms
19
21
runs-on : ${{ matrix.os }}
20
22
strategy :
21
23
matrix :
@@ -27,23 +29,25 @@ jobs:
27
29
- uses : actions/checkout@v4
28
30
with :
29
31
persist-credentials : false
30
- fetch-tags : true
32
+ fetch-depth : 0
31
33
- name : Setup Python
32
34
uses : actions/setup-python@v5
33
35
with :
34
36
python-version : ${{ matrix.python-version }}
35
37
- 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
38
+ if : ${{ !startsWith(runner.os, 'macOS') }}
39
+ run : |
40
+ docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongo:${MONGODB_VERSION} mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5
41
+ until docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do
42
+ sleep 1
43
+ done
44
+ sudo docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "rs.initiate({\"_id\":\"rs\",\"members\":[{\"_id\":0,\"host\":\"127.0.0.1:27017\" }]})"
41
45
- name : Start MongoDB on MacOS
42
46
if : ${{ startsWith(runner.os, 'macOS') }}
43
47
run : |
44
48
brew tap mongodb/brew
45
- brew install mongodb-community@8.0
46
- brew services start mongodb-community@8.0
49
+ brew install mongodb-community@${MONGODB_VERSION}
50
+ brew services start mongodb-community@${MONGODB_VERSION}
47
51
- name : Install package and pytest
48
52
run : |
49
53
python -m pip install .
0 commit comments