diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e19b4f80f..dc75139f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,14 @@ jobs: ports: - 3306:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + postgres: + image: postgres:11 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: 1234 + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 strategy: matrix: php: [7.2, 7.3, 7.4] @@ -33,6 +41,7 @@ jobs: uses: shivammathur/setup-php@2.7.0 with: php-version: ${{ matrix.php }} + extensions: pgsql coverage: none - name: Cache dependencies @@ -66,6 +75,28 @@ jobs: USE_FOUNDRY_BUNDLE: 1 DATABASE_URL: mysql://root:1234@127.0.0.1:3306/zenstruck_foundry?serverVersion=5.7 + - name: 'Test: PostgreSQL' + run: vendor/bin/phpunit -v + env: + DATABASE_URL: postgresql://postgres:1234@127.0.0.1:5432/zenstruck_foundry?charset=utf8 + + - name: 'Test: PostgreSQL, FoundryBundle' + run: vendor/bin/phpunit -v + env: + USE_FOUNDRY_BUNDLE: 1 + DATABASE_URL: postgresql://postgres:1234@127.0.0.1:5432/zenstruck_foundry?charset=utf8 + +# - name: 'Test: PostgreSQL, DAMABundle' +# run: vendor/bin/phpunit -v --configuration phpunit-dama-doctrine.xml.dist +# env: +# DATABASE_URL: postgresql://postgres:1234@127.0.0.1:5432/zenstruck_foundry?charset=utf8 + +# - name: 'Test: PostgreSQL, FoundryBundle, DAMABundle' +# run: vendor/bin/phpunit -v --configuration phpunit-dama-doctrine.xml.dist +# env: +# USE_FOUNDRY_BUNDLE: 1 +# DATABASE_URL: postgresql://postgres:1234@127.0.0.1:5432/zenstruck_foundry?charset=utf8 + - name: 'Test: SQLite' run: vendor/bin/phpunit -v env: @@ -99,6 +130,14 @@ jobs: ports: - 3306:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + postgres: + image: postgres:11 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: 1234 + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - name: Checkout code uses: actions/checkout@v2.3.3 @@ -110,6 +149,7 @@ jobs: uses: shivammathur/setup-php@2.7.0 with: php-version: 7.4 + extensions: pgsql coverage: xdebug - name: Cache dependencies @@ -143,6 +183,28 @@ jobs: USE_FOUNDRY_BUNDLE: 1 DATABASE_URL: mysql://root:1234@127.0.0.1:3306/zenstruck_foundry?serverVersion=5.7 + - name: 'Coverage: PostgreSQL' + run: vendor/bin/phpunit -v --coverage-text --coverage-clover=postgres.clover + env: + DATABASE_URL: postgresql://postgres:1234@127.0.0.1:5432/zenstruck_foundry?charset=utf8 + + - name: 'Coverage: PostgreSQL, FoundryBundle' + run: vendor/bin/phpunit -v --coverage-text --coverage-clover=postgres-foundry.clover + env: + USE_FOUNDRY_BUNDLE: 1 + DATABASE_URL: postgresql://postgres:1234@127.0.0.1:5432/zenstruck_foundry?charset=utf8 + +# - name: 'Coverage: PostgreSQL, DAMABundle' +# run: vendor/bin/phpunit -v --coverage-text --coverage-clover=postgres-dama.clover --configuration phpunit-dama-doctrine.xml.dist +# env: +# DATABASE_URL: postgresql://postgres:1234@127.0.0.1:5432/zenstruck_foundry?charset=utf8 + +# - name: 'Coverage: PostgreSQL, FoundryBundle, DAMABundle' +# run: vendor/bin/phpunit -v --coverage-text --coverage-clover=postgres-foundry-dama.clover --configuration phpunit-dama-doctrine.xml.dist +# env: +# USE_FOUNDRY_BUNDLE: 1 +# DATABASE_URL: postgresql://postgres:1234@127.0.0.1:5432/zenstruck_foundry?charset=utf8 + - name: 'Coverage: SQLite' run: vendor/bin/phpunit -v --coverage-text --coverage-clover=sqlite.clover env: @@ -172,6 +234,8 @@ jobs: php ocular.phar code-coverage:upload --format=php-clover mysql-foundry.clover php ocular.phar code-coverage:upload --format=php-clover mysql-dama.clover php ocular.phar code-coverage:upload --format=php-clover mysql-foundry-dama.clover + php ocular.phar code-coverage:upload --format=php-clover postgres.clover + php ocular.phar code-coverage:upload --format=php-clover postgres-foundry.clover php ocular.phar code-coverage:upload --format=php-clover sqlite.clover php ocular.phar code-coverage:upload --format=php-clover sqlite-foundry.clover php ocular.phar code-coverage:upload --format=php-clover sqlite-dama.clover diff --git a/.scrutinizer.yml b/.scrutinizer.yml index bcef01199..e6148f1a5 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -5,7 +5,7 @@ checks: tools: external_code_coverage: timeout: 900 - runs: 8 + runs: 10 build: nodes: analysis: diff --git a/tests/Fixtures/Entity/Category.php b/tests/Fixtures/Entity/Category.php index 5d0468dd2..58902763f 100644 --- a/tests/Fixtures/Entity/Category.php +++ b/tests/Fixtures/Entity/Category.php @@ -7,6 +7,7 @@ /** * @ORM\Entity + * @ORM\Table(name="categories") */ class Category { diff --git a/tests/Fixtures/Entity/Comment.php b/tests/Fixtures/Entity/Comment.php index 6f69d4b3a..c4557bc07 100644 --- a/tests/Fixtures/Entity/Comment.php +++ b/tests/Fixtures/Entity/Comment.php @@ -6,6 +6,7 @@ /** * @ORM\Entity + * @ORM\Table(name="comments") */ class Comment { diff --git a/tests/Fixtures/Entity/Post.php b/tests/Fixtures/Entity/Post.php index e30f554ed..f98143fa0 100644 --- a/tests/Fixtures/Entity/Post.php +++ b/tests/Fixtures/Entity/Post.php @@ -7,6 +7,7 @@ /** * @ORM\Entity(repositoryClass="Zenstruck\Foundry\Tests\Fixtures\Repository\PostRepository") + * @ORM\Table(name="posts") */ class Post { diff --git a/tests/Fixtures/Entity/Tag.php b/tests/Fixtures/Entity/Tag.php index 9168547c6..43c58fba6 100644 --- a/tests/Fixtures/Entity/Tag.php +++ b/tests/Fixtures/Entity/Tag.php @@ -7,6 +7,7 @@ /** * @ORM\Entity + * @ORM\Table(name="tags") */ class Tag { diff --git a/tests/Fixtures/Entity/User.php b/tests/Fixtures/Entity/User.php index 25d86166f..00015f3f5 100644 --- a/tests/Fixtures/Entity/User.php +++ b/tests/Fixtures/Entity/User.php @@ -6,6 +6,7 @@ /** * @ORM\Entity + * @ORM\Table(name="users") */ class User {