Skip to content

Commit f87e770

Browse files
committedMar 11, 2025
PHPORM-306 Test with MongoDB Driver v2
1 parent 0d7bc9d commit f87e770

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed
 

Diff for: ‎.github/workflows/build-ci.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,20 @@ jobs:
2929
- "10.*"
3030
- "11.*"
3131
- "12.*"
32+
driver:
33+
- "1.21.0"
3234
include:
3335
- php: "8.1"
3436
laravel: "10.*"
3537
mongodb: "5.0"
3638
mode: "low-deps"
3739
os: "ubuntu-latest"
40+
driver: "1.21.0"
41+
- php: "8.4"
42+
laravel: "12.*"
43+
mongodb: "8.0"
44+
os: "ubuntu-latest"
45+
driver: "mongodb/mongo-php-driver@v2.x"
3846
exclude:
3947
- php: "8.1"
4048
laravel: "11.*"
@@ -59,11 +67,19 @@ jobs:
5967
if [ "${{ matrix.mongodb }}" = "4.4" ]; then MONGOSH_BIN="mongo"; else MONGOSH_BIN="mongosh"; fi
6068
docker exec --tty mongodb $MONGOSH_BIN --eval "db.runCommand({ serverStatus: 1 })"
6169
70+
- name: Setup cache environment
71+
id: extcache
72+
uses: shivammathur/cache-extensions@v1
73+
with:
74+
php-version: ${{ matrix.php }}
75+
extensions: "mongodb-${{ matrix.driver }}"
76+
key: "extcache-v1"
77+
6278
- name: "Installing php"
6379
uses: "shivammathur/setup-php@v2"
6480
with:
6581
php-version: ${{ matrix.php }}
66-
extensions: "curl,mbstring,xdebug"
82+
extensions: "curl,mbstring,xdebug,mongodb-${{ matrix.driver }}"
6783
coverage: "xdebug"
6884
tools: "composer"
6985

Diff for: ‎.github/workflows/static-analysis.yml

+14
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424
- '8.1'
2525
- '8.2'
2626
- '8.3'
27+
- '8.4'
28+
driver:
29+
- "1.21.0"
30+
include:
31+
- php: '8.4'
32+
driver: 'mongodb/mongo-php-driver@v2.x'
2733
steps:
2834
- name: Checkout
2935
uses: actions/checkout@v4
@@ -35,6 +41,14 @@ jobs:
3541
run: |
3642
echo CHECKED_OUT_SHA=$(git rev-parse HEAD) >> $GITHUB_ENV
3743
44+
- name: Setup cache environment
45+
id: extcache
46+
uses: shivammathur/cache-extensions@v1
47+
with:
48+
php-version: ${{ matrix.php }}
49+
extensions: "mongodb-${{ matrix.driver }}"
50+
key: "extcache-v1"
51+
3852
- name: Setup PHP
3953
uses: shivammathur/setup-php@v2
4054
with:

Diff for: ‎composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
"license": "MIT",
2424
"require": {
2525
"php": "^8.1",
26-
"ext-mongodb": "^1.21",
26+
"ext-mongodb": "^1.21|^2",
2727
"composer-runtime-api": "^2.0.0",
2828
"illuminate/cache": "^10.36|^11|^12",
2929
"illuminate/container": "^10.0|^11|^12",
3030
"illuminate/database": "^10.30|^11|^12",
3131
"illuminate/events": "^10.0|^11|^12",
3232
"illuminate/support": "^10.0|^11|^12",
33-
"mongodb/mongodb": "^1.21",
33+
"mongodb/mongodb": "^1.21|^2",
3434
"symfony/http-foundation": "^6.4|^7"
3535
},
3636
"require-dev": {

0 commit comments

Comments
 (0)