Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPORM-266 Run tests on Atlas Local #3216

Draft
wants to merge 3 commits into
base: 5.x
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 34 additions & 22 deletions .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,57 @@ 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"
if: ${{ matrix.mongodb == 'Atlas' }}
run: |
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
# is there a starting issue?
sleep 10

- name: "Show MongoDB server status"
run: |
if [ "${{ matrix.mongodb }}" = "4.4" ]; then MONGOSH_BIN="mongo"; else MONGOSH_BIN="mongosh"; fi
Expand Down
Loading