@@ -71,16 +71,93 @@ jobs:
7171 command : composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress --with="phpunit/phpunit:~${{ matrix.phpunit }}"
7272
7373 - name : Execute tests
74- run : vendor/bin/phpunit
74+ run : vendor/bin/phpunit --exclude-group database-external
7575 env :
7676 DB_PORT : ${{ job.services.mysql.ports[3306] }}
7777 DB_USERNAME : root
7878
79+ database_driver_tests :
80+ runs-on : ubuntu-24.04
81+
82+ services :
83+ mysql :
84+ image : mysql:5.7
85+ env :
86+ MYSQL_ALLOW_EMPTY_PASSWORD : yes
87+ MYSQL_DATABASE : testing
88+ ports :
89+ - 33306:3306
90+ options : --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
91+ postgres :
92+ image : postgres:16
93+ env :
94+ POSTGRES_DB : testing
95+ POSTGRES_USER : postgres
96+ POSTGRES_PASSWORD : postgres
97+ ports :
98+ - 35432:5432
99+ options : >-
100+ --health-cmd="pg_isready -U postgres -d testing"
101+ --health-interval=10s
102+ --health-timeout=5s
103+ --health-retries=5
104+
105+ strategy :
106+ fail-fast : false
107+ matrix :
108+ driver : [mysql, pgsql]
109+
110+ name : External DB - ${{ matrix.driver }}
111+
112+ steps :
113+ - name : Checkout code
114+ uses : actions/checkout@v4
115+
116+ - name : Setup PHP
117+ uses : shivammathur/setup-php@v2
118+ with :
119+ php-version : 8.5
120+ extensions : dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, pdo_mysql, pgsql, pdo_pgsql
121+ ini-values : error_reporting=E_ALL
122+ tools : composer:v2
123+ coverage : none
124+
125+ - name : Set Framework version
126+ run : composer config version "2.x-dev"
127+
128+ - name : Install dependencies
129+ uses : nick-fields/retry@v3
130+ with :
131+ timeout_minutes : 5
132+ max_attempts : 5
133+ command : composer update --prefer-stable --prefer-dist --no-interaction --no-progress --with="phpunit/phpunit:~12.5.8"
134+
135+ - name : Execute MySQL model query tests
136+ if : matrix.driver == 'mysql'
137+ run : vendor/bin/phpunit --group mysql
138+ env :
139+ DOPPAR_TEST_MYSQL_HOST : 127.0.0.1
140+ DOPPAR_TEST_MYSQL_PORT : ${{ job.services.mysql.ports[3306] }}
141+ DOPPAR_TEST_MYSQL_DATABASE : testing
142+ DOPPAR_TEST_MYSQL_USERNAME : root
143+ DOPPAR_TEST_MYSQL_PASSWORD : ' '
144+ DOPPAR_TEST_MYSQL_CHARSET : utf8mb4
145+
146+ - name : Execute PostgreSQL model query tests
147+ if : matrix.driver == 'pgsql'
148+ run : vendor/bin/phpunit --group pgsql
149+ env :
150+ DOPPAR_TEST_PGSQL_HOST : 127.0.0.1
151+ DOPPAR_TEST_PGSQL_PORT : ${{ job.services.postgres.ports[5432] }}
152+ DOPPAR_TEST_PGSQL_DATABASE : testing
153+ DOPPAR_TEST_PGSQL_USERNAME : postgres
154+ DOPPAR_TEST_PGSQL_PASSWORD : postgres
155+
79156 - name : Store artifacts
80157 if : always()
81158 uses : actions/upload-artifact@v4
82159 with :
83- name : linux- logs-${{ matrix.php }}-${{ matrix.phpunit }}-${{ matrix.stability }}
160+ name : external-db- logs-${{ matrix.driver }}
84161 path : |
85162 vendor/orchestra/testbench-core/doppar/storage/logs
86163 !vendor/**/.gitignore
@@ -132,7 +209,7 @@ jobs:
132209 command : composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress --with="phpunit/phpunit:~${{ matrix.phpunit }}"
133210
134211 - name : Execute tests
135- run : vendor/bin/phpunit
212+ run : vendor/bin/phpunit --exclude-group database-external
136213
137214 - name : Store artifacts
138215 if : always()
@@ -141,4 +218,4 @@ jobs:
141218 name : windows-logs-${{ matrix.php }}-${{ matrix.phpunit }}-${{ matrix.stability }}
142219 path : |
143220 vendor/orchestra/testbench-core/doppar/storage/logs
144- !vendor/**/.gitignore
221+ !vendor/**/.gitignore
0 commit comments