From 6e5b59bc636c47a96501c0cacadee3a8f0778e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Thu, 21 Nov 2024 16:43:06 +0100 Subject: [PATCH 1/3] PHPORM-266 Run tests on Atlas Local --- .github/workflows/build-ci.yml | 55 ++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index 45833d579..69ec90dbf 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -15,45 +15,56 @@ jobs: os: - "ubuntu-latest" mongodb: - - "4.4" - - "5.0" - - "6.0" - - "7.0" + #- "4.4" + #- "5.0" + #- "6.0" + #- "7.0" + - "Atlas" php: - - "8.1" - - "8.2" + #- "8.1" + #- "8.2" - "8.3" laravel: - - "10.*" + #- "10.*" - "11.*" - include: - - php: "8.1" - laravel: "10.*" - mongodb: "5.0" - mode: "low-deps" - os: "ubuntu-latest" - - php: "8.4" - laravel: "11.*" - mongodb: "7.0" - mode: "ignore-php-req" - os: "ubuntu-latest" - exclude: - - php: "8.1" - laravel: "11.*" + #include: + #- php: "8.1" + # laravel: "10.*" + # mongodb: "5.0" + # mode: "low-deps" + # os: "ubuntu-latest" + #- php: "8.4" + # laravel: "11.*" + # mongodb: "7.0" + # mode: "ignore-php-req" + # os: "ubuntu-latest" + #exclude: + #- php: "8.1" + # laravel: "11.*" steps: - uses: "actions/checkout@v4" - name: "Create MongoDB Replica Set" + if: ${{ matrix.mongodb != 'Atlas' }} run: | docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongo:${{ matrix.mongodb }} mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5 if [ "${{ matrix.mongodb }}" = "4.4" ]; then MONGOSH_BIN="mongo"; else MONGOSH_BIN="mongosh"; fi until docker exec --tty mongodb $MONGOSH_BIN 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do - sleep 1 + sleep 1 done 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\" }]})" + - name: "Create MongoDB Atlas Local Cluster" + if: ${{ matrix.mongodb == 'Atlas' }} + run: | + docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongodb/mongodb-atlas-local:latest mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5 + until docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do + sleep 1 + done + 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\" }]})" + - name: "Show MongoDB server status" run: | if [ "${{ matrix.mongodb }}" = "4.4" ]; then MONGOSH_BIN="mongo"; else MONGOSH_BIN="mongosh"; fi From a954df7e5eb7c95b6267cd1502039e894353105a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Thu, 21 Nov 2024 18:10:55 +0100 Subject: [PATCH 2/3] Remove RS --- .github/workflows/build-ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index 69ec90dbf..97439d44d 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -56,14 +56,13 @@ jobs: done 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\" }]})" - - name: "Create MongoDB Atlas Local Cluster" + - name: "Create MongoDB Atlas Local" if: ${{ matrix.mongodb == 'Atlas' }} run: | - docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongodb/mongodb-atlas-local:latest mongod --replSet rs --setParameter transactionLifetimeLimitSeconds=5 + docker run --name mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=unittest --detach mongodb/mongodb-atlas-local:latest until docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do sleep 1 done - 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\" }]})" - name: "Show MongoDB server status" run: | From cb73ce40a3760f63fdfa5b58d37a300c2aff7fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 10 Dec 2024 11:59:50 -0500 Subject: [PATCH 3/3] is there a starting issue? --- .github/workflows/build-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index 97439d44d..d04181fe7 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -63,6 +63,8 @@ jobs: until docker exec --tty mongodb mongosh 127.0.0.1:27017 --eval "db.runCommand({ ping: 1 })"; do sleep 1 done + # is there a starting issue? + sleep 10 - name: "Show MongoDB server status" run: |