2929 - type : postgresql
3030 version : ' 13'
3131 port : 5432
32+ - type : sqlite
33+ version : ' 3'
34+ port : 0
3235 fail-fast : false
3336
3437 name : PHP ${{ matrix.php-version }} - ${{ matrix.database.type }} ${{ matrix.database.version }}
8386 uses : shivammathur/setup-php@v2
8487 with :
8588 php-version : ${{ matrix.php-version }}
86- extensions : bcmath, curl, gd, iconv, mysqli, pdo_mysql, pdo_pgsql, pgsql, soap, zip, fileinfo, openssl, simplexml, mbstring, intl
89+ extensions : bcmath, curl, gd, iconv, mysqli, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, soap, zip, fileinfo, openssl, simplexml, mbstring, intl
8790 coverage : xdebug
8891 tools : composer:v2
8992 env :
@@ -109,10 +112,13 @@ jobs:
109112 echo "Testing ${{ matrix.database.type }} ${{ matrix.database.version }} connection..."
110113 mysql --host=${{ env.DB_HOST }} --user=${{ env.DB_USER }} --password=${{ env.DB_PASS }} -e "SHOW DATABASES;"
111114 mysql --host=${{ env.DB_HOST }} --user=${{ env.DB_USER }} --password=${{ env.DB_PASS }} -e "SELECT VERSION();"
112- else
115+ elif [ "${{ matrix.database.type }}" = "postgresql" ]; then
113116 echo "Testing PostgreSQL ${{ matrix.database.version }} connection..."
114117 PGPASSWORD=${{ env.DB_PASS }} psql -h ${{ env.DB_HOST }} -U ${{ env.DB_USER }} -d ${{ env.DB_NAME }} -c "\l"
115118 PGPASSWORD=${{ env.DB_PASS }} psql -h ${{ env.DB_HOST }} -U ${{ env.DB_USER }} -d ${{ env.DB_NAME }} -c "SELECT version();"
119+ else
120+ echo "Testing SQLite ${{ matrix.database.version }} support..."
121+ php -r 'exit(in_array("sqlite", PDO::getAvailableDrivers(), true) ? 0 : 1);'
116122 fi
117123
118124 - name : Create application config
@@ -139,7 +145,7 @@ jobs:
139145 define('FS_DISABLE_ADD_PLUGINS', false);
140146 define('FS_DISABLE_RM_PLUGINS', false);
141147 EOF
142- else
148+ elif [ "${{ matrix.database.type }}" = "postgresql" ]; then
143149 cat > config.php << 'EOF'
144150 <?php
145151 define('FS_COOKIES_EXPIRE', 31536000);
@@ -159,6 +165,26 @@ jobs:
159165 define('FS_DISABLE_ADD_PLUGINS', false);
160166 define('FS_DISABLE_RM_PLUGINS', false);
161167 EOF
168+ else
169+ cat > config.php << 'EOF'
170+ <?php
171+ define('FS_COOKIES_EXPIRE', 31536000);
172+ define('FS_ROUTE', '');
173+ define('FS_DB_TYPE', 'sqlite');
174+ define('FS_DB_HOST', '');
175+ define('FS_DB_PORT', 0);
176+ define('FS_DB_NAME', 'MyFiles/facturascripts_test.sqlite');
177+ define('FS_DB_USER', '');
178+ define('FS_DB_PASS', '');
179+ define('FS_DB_FOREIGN_KEYS', true);
180+ define('FS_DB_TYPE_CHECK', true);
181+ define('FS_LANG', 'es_ES');
182+ define('FS_TIMEZONE', 'Europe/Madrid');
183+ define('FS_HIDDEN_PLUGINS', '');
184+ define('FS_DEBUG', true);
185+ define('FS_DISABLE_ADD_PLUGINS', false);
186+ define('FS_DISABLE_RM_PLUGINS', false);
187+ EOF
162188 fi
163189
164190 - name : Run PHPUnit tests
0 commit comments