Skip to content

Commit

Permalink
Add CI jobs for SQLite3 driver (#10141)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Oct 17, 2022
1 parent 90bc6dc commit 119c378
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -38,15 +38,21 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
dbal-version:
- "default"
extension:
- "pdo_sqlite"
include:
- php-version: "8.0"
dbal-version: "2.13"
extension: "pdo_sqlite"
- php-version: "8.1"
dbal-version: "3@dev"
- php-version: "8.2"
extension: "pdo_sqlite"
- php-version: "8.1"
dbal-version: "3@dev"
extension: "sqlite3"

steps:
- name: "Checkout"
Expand All @@ -58,7 +64,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "apcu, pdo, pdo_sqlite"
extensions: "apcu, pdo, ${{ matrix.extension }}"
coverage: "pcov"
ini-values: "zend.assertions=1"

Expand All @@ -72,19 +78,19 @@ jobs:
composer-options: "--ignore-platform-req=php+"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --coverage-clover=coverage-no-cache.xml"
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage-no-cache.xml"
env:
ENABLE_SECOND_LEVEL_CACHE: 0

- name: "Run PHPUnit with Second Level Cache"
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --exclude-group performance,non-cacheable,locking_functional --coverage-clover=coverage-cache.xml"
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --exclude-group performance,non-cacheable,locking_functional --coverage-clover=coverage-cache.xml"
env:
ENABLE_SECOND_LEVEL_CACHE: 1

- name: "Upload coverage file"
uses: "actions/upload-artifact@v3"
with:
name: "phpunit-sqlite-${{ matrix.php-version }}-${{ matrix.dbal-version }}-coverage"
name: "phpunit-${{ matrix.extension }}-${{ matrix.php-version }}-${{ matrix.dbal-version }}-coverage"
path: "coverage*.xml"


Expand Down Expand Up @@ -343,7 +349,7 @@ jobs:
dependency-versions: "${{ matrix.deps }}"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml"
run: "vendor/bin/phpunit -c ci/github/phpunit/pdo_sqlite.xml"


upload_coverage:
Expand Down
File renamed without changes.
38 changes: 38 additions & 0 deletions ci/github/phpunit/sqlite3.xml
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
convertDeprecationsToExceptions="true"
>
<php>
<ini name="error_reporting" value="-1" />
<!-- use an in-memory sqlite database -->
<var name="db_driver" value="sqlite3"/>
<var name="db_memory" value="true"/>

<!-- necessary change for some CLI/console output test assertions -->
<env name="COLUMNS" value="120"/>
</php>

<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../../../tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">../../../lib/Doctrine</directory>
</whitelist>
</filter>

<groups>
<exclude>
<group>performance</group>
<group>locking_functional</group>
</exclude>
</groups>
</phpunit>

0 comments on commit 119c378

Please sign in to comment.