Skip to content

Commit 7c83373

Browse files
committed
Add specific CI jobs for Persistence 3
1 parent 021164f commit 7c83373

File tree

4 files changed

+72
-2
lines changed

4 files changed

+72
-2
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,51 @@ env:
1212
fail-fast: true
1313

1414
jobs:
15+
phpunit-unstable:
16+
name: "PHPUnit with unstable dependencies"
17+
runs-on: "ubuntu-20.04"
18+
19+
strategy:
20+
matrix:
21+
php-version:
22+
- "8.1"
23+
24+
steps:
25+
- name: "Checkout"
26+
uses: "actions/checkout@v2"
27+
with:
28+
fetch-depth: 2
29+
30+
- name: "Install PHP"
31+
uses: "shivammathur/setup-php@v2"
32+
with:
33+
php-version: "${{ matrix.php-version }}"
34+
extensions: "pdo, pdo_sqlite"
35+
coverage: "pcov"
36+
ini-values: "zend.assertions=1"
37+
38+
- name: "Require specific doctrine/persistence version"
39+
run: "composer require doctrine/persistence '3.0.x-dev as 2.4.0' --no-update"
40+
41+
- name: "Install dependencies with Composer"
42+
uses: "ramsey/composer-install@v1"
43+
44+
- name: "Run PHPUnit"
45+
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --coverage-clover=coverage-no-cache.xml"
46+
env:
47+
ENABLE_SECOND_LEVEL_CACHE: 0
48+
49+
- name: "Run PHPUnit with Second Level Cache"
50+
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --exclude-group performance,non-cacheable,locking_functional --coverage-clover=coverage-cache.xml"
51+
env:
52+
ENABLE_SECOND_LEVEL_CACHE: 1
53+
54+
- name: "Upload coverage file"
55+
uses: "actions/upload-artifact@v2"
56+
with:
57+
name: "phpunit-sqlite-${{ matrix.php-version }}-unstable-coverage"
58+
path: "coverage*.xml"
59+
1560
phpunit-smoke-check:
1661
name: "PHPUnit with SQLite"
1762
runs-on: "ubuntu-20.04"

.github/workflows/static-analysis.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ jobs:
2121
- "8.1"
2222
dbal-version:
2323
- "default"
24-
- "2.13"
24+
persistence-version:
25+
- "default"
26+
include:
27+
- php-version: "8.1"
28+
dbal-version: "2.13"
29+
persistence-version: "default"
30+
- php-version: "8.1"
31+
dbal-version: "default"
32+
persistence-version: "'3.0.x-dev as 2.4.0'"
2533

2634
steps:
2735
- name: "Checkout code"
@@ -37,19 +45,27 @@ jobs:
3745
run: "composer require doctrine/dbal ^${{ matrix.dbal-version }} --no-update"
3846
if: "${{ matrix.dbal-version != 'default' }}"
3947

48+
- name: "Require specific persistence version"
49+
run: "composer require doctrine/persistence ${{ matrix.persistence-version }} --no-update"
50+
if: "${{ matrix.persistence-version != 'default' }}"
51+
4052
- name: "Install dependencies with Composer"
4153
uses: "ramsey/composer-install@v1"
4254
with:
4355
dependency-versions: "highest"
4456

4557
- name: "Run a static analysis with phpstan/phpstan"
4658
run: "vendor/bin/phpstan analyse"
47-
if: "${{ matrix.dbal-version == 'default' }}"
59+
if: "${{ matrix.dbal-version == 'default' && matrix.persistence-version == 'default'}}"
4860

4961
- name: "Run a static analysis with phpstan/phpstan"
5062
run: "vendor/bin/phpstan analyse -c phpstan-dbal2.neon"
5163
if: "${{ matrix.dbal-version == '2.13' }}"
5264

65+
- name: "Run a static analysis with phpstan/phpstan"
66+
run: "vendor/bin/phpstan analyse -c phpstan-persistence3.neon"
67+
if: "${{ matrix.dbal-version == 'default' && matrix.persistence-version != 'default'}}"
68+
5369
static-analysis-psalm:
5470
name: "Static Analysis with Psalm"
5571
runs-on: "ubuntu-20.04"

phpstan-persistence3.neon

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
includes:
2+
- phpstan.neon
3+
4+
parameters:
5+
ignoreErrors:
6+
-
7+
message: '/clear.*invoked with 1 parameter/'
8+
path: lib/Doctrine/ORM/EntityRepository.php

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<referencedClass name="Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand"/>
3232
<referencedClass name="Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand"/>
3333
<referencedClass name="Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand"/>
34+
<referencedClass name="Doctrine\Common\Persistence\PersistentObject"/>
3435
</errorLevel>
3536
</DeprecatedClass>
3637
<DeprecatedInterface>

0 commit comments

Comments
 (0)