File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 19
19
- " 5.0"
20
20
- " 6.0"
21
21
- " 7.0"
22
+ - " Atlas"
22
23
php :
23
24
- " 8.1"
24
25
- " 8.2"
@@ -45,15 +46,24 @@ jobs:
45
46
- uses : " actions/checkout@v4"
46
47
47
48
- name : " Create MongoDB Replica Set"
49
+ if : ${{ matrix.mongodb != 'Atlas' }}
48
50
run : |
49
51
docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongo:${{ matrix.mongodb }} mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5
50
52
51
53
if [ "${{ matrix.mongodb }}" = "4.4" ]; then MONGOSH_BIN="mongo"; else MONGOSH_BIN="mongosh"; fi
52
54
until docker exec --tty mongodb $MONGOSH_BIN 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do
53
- sleep 1
55
+ sleep 1
54
56
done
55
57
sudo docker exec --tty mongodb $MONGOSH_BIN 127.0.0.1:27017 --eval "rs.initiate({\"_id\":\"rs\",\"members\":[{\"_id\":0,\"host\":\"127.0.0.1:27017\" }]})"
56
58
59
+ - name : " Create MongoDB Atlas Local"
60
+ if : ${{ matrix.mongodb == 'Atlas' }}
61
+ run : |
62
+ docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongodb/mongodb-atlas-local:latest
63
+ until docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do
64
+ sleep 1
65
+ done
66
+
57
67
- name : " Show MongoDB server status"
58
68
run : |
59
69
if [ "${{ matrix.mongodb }}" = "4.4" ]; then MONGOSH_BIN="mongo"; else MONGOSH_BIN="mongosh"; fi
93
103
- name : " Run tests"
94
104
run : " ./vendor/bin/phpunit --coverage-clover coverage.xml"
95
105
env :
96
- MONGODB_URI : ' mongodb://127.0.0.1/?replicaSet=rs '
106
+ MONGODB_URI : ' mongodb://127.0.0.1/'
You can’t perform that action at this time.
0 commit comments