Skip to content

Support MongoDB Driver 2.0 #90

Support MongoDB Driver 2.0

Support MongoDB Driver 2.0 #90

Workflow file for this run

name: Test
on:
pull_request: ~
push:
branches:
- "*.*"
- "feature/*"
permissions:
contents: read
jobs:
test:
name: PHP ${{ matrix.php-version }} + ${{ matrix.driver-version }} + ${{ matrix.dependencies }} + ${{ matrix.variant }}
runs-on: ubuntu-latest
services:
mongodb_primary:
image: mongo:8
env:
MONGO_INITDB_ROOT_USERNAME: "primary"
MONGO_INITDB_ROOT_PASSWORD: "password"
ports:
- "27017:27017"
mongodb_secondary:
image: mongo:8
env:
MONGO_INITDB_ROOT_USERNAME: "secondary"
MONGO_INITDB_ROOT_PASSWORD: "password"
ports:
- "27018:27018"
continue-on-error: true
env:
SYMFONY_REQUIRE: ${{ matrix.symfony-require }}
MONGODB_PRIMARY_URL: 'mongodb://primary:password@localhost:27017'
MONGODB_SECONDARY_URL: 'mongodb://secondary:password@localhost:27018'
strategy:
matrix:
php-version:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
driver-version:
- 'stable'
dependencies:
- 'highest'
- 'lowest'
symfony-require:
- ''
variant:
- 'normal'
- 'symfony/symfony:"6.3.*"'
- 'symfony/symfony:"6.4.*"'
- 'symfony/symfony:"7.0.*"'
include:
- php_version: '8.4'
driver_version: 'mongodb/mongo-php-driver@v2.x'
dependencies: 'highest'
symfony-require: ''
variant: 'normal'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Add PHPUnit matcher
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Globally install symfony/flex
if: matrix.symfony-require != ''
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins symfony/flex
- name: Install variant
if: matrix.variant != 'normal' && !startsWith(matrix.variant, 'symfony/symfony')
run: composer require ${{ matrix.variant }} --no-update
- name: Install Composer dependencies (${{ matrix.dependencies }})
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}
- name: Run Tests
run: vendor/bin/simple-phpunit --configuration=phpunit.xml.dist