Skip to content

Commit

Permalink
ci: add build on multiple mongo versions
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent4vx committed Feb 26, 2024
1 parent 4ad67b5 commit 69b9c7d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,39 @@ jobs:
- name: Run test suite
run: composer run-script tests

mongo_compatibility:
runs-on: ubuntu-latest
strategy:
matrix:
mongo-versions: ['5', '6', '7']
name: Compatibility mongodb ${{ matrix.mongo-versions }}

steps:
- uses: actions/checkout@v2

- name: Set Timezone
uses: szenius/set-timezone@v1.0
with:
timezoneLinux: "Europe/Paris"

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: json
ini-values: date.timezone=Europe/Paris

- name: MongoDB in GitHub Actions
uses: supercharge/mongodb-github-action@1.6.0
with:
mongodb-version: ${{ matrix.mongo-versions }}

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run test suite
run: composer run-script tests

analysis:
name: Analysis
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion tests/MongoDB/Schema/CollectionStructureUpgraderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public function test_drop()
$this->assertTrue($this->resolver->drop());
$this->assertEmpty($this->connection->runCommand('listCollections')->toArray());

$this->assertFalse($this->resolver->drop());
$this->resolver->drop(); // true in mongo >= 7, false in mongo < 7
$this->assertEmpty($this->connection->runCommand('listCollections')->toArray());
}

Expand Down

0 comments on commit 69b9c7d

Please sign in to comment.