@@ -60,40 +60,14 @@ jobs:
6060 extensions : mbstring, pdo_mysql, zip, exif, intl, gd, bcmath, curl, dom, xdebug
6161 coverage : xdebug
6262
63- - name : Wait for MySQL
64- run : |
65- for i in {30..0}; do
66- if mysqladmin ping -h 127.0.0.1 --silent; then
67- echo "MySQL is ready"
68- break
69- fi
70- echo "Waiting for MySQL ($i)..."
71- sleep 1
72- done
73-
74- - name : Cache Composer dependencies
75- uses : actions/cache@v3
76- with :
77- path : vendor
78- key : ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }}
79- restore-keys : |
80- ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-
81-
82- - name : Adjust Laravel/Testbench version per matrix
83- run : |
84- composer remove laravel/framework orchestra/testbench --no-update || true
85- composer require laravel/framework:^${{ matrix.laravel }} --no-update
86- composer update --no-interaction --prefer-dist --no-progress
87-
88- - name : Run Tests
89- run : vendor/bin/phpunit --coverage-clover=coverage/clover.xml --path-coverage
63+ - name : Run PHPUnit
64+ run : vendor/bin/phpunit --coverage-php=coverage/coverage.cov
9065
9166 - name : Upload coverage artifact
9267 uses : actions/upload-artifact@v4
9368 with :
9469 name : coverage-mysql-${{ matrix.laravel }}-${{ matrix.php }}-${{ matrix.mysql }}
95- path : coverage/clover.xml
96-
70+ path : coverage/coverage.cov
9771
9872 test-pgsql :
9973 name : Laravel ${{ matrix.laravel }} / PHP ${{ matrix.php }} / PostgreSQL 15
10377 matrix :
10478 laravel : [ 10, 11, 12 ]
10579 php : [ 8.2, 8.3, 8.4 ]
80+
10681 exclude :
10782 - laravel : 10
10883 php : 8.4
@@ -140,52 +115,23 @@ jobs:
140115 extensions : mbstring, pdo_pgsql, zip, exif, intl, gd, bcmath, curl, dom, xdebug
141116 coverage : xdebug
142117
143- - name : Wait for Postgres
144- run : |
145- for i in {30..0}; do
146- if pg_isready -h 127.0.0.1 -U postgres; then
147- echo "Postgres is ready"
148- break
149- fi
150- echo "Waiting for Postgres ($i)..."
151- sleep 1
152- done
153-
154- - name : Cache Composer dependencies
155- uses : actions/cache@v3
156- with :
157- path : vendor
158- key : ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }}
159- restore-keys : |
160- ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-
161-
162- - name : Adjust Laravel/Testbench version per matrix
163- run : |
164- composer remove laravel/framework orchestra/testbench --no-update || true
165- composer require laravel/framework:^${{ matrix.laravel }} --no-update
166- composer update --no-interaction --prefer-dist --no-progress
167-
168- - name : Run Tests
169- run : vendor/bin/phpunit --coverage-clover=coverage/clover.xml --path-coverage
118+ - name : Run PHPUnit
119+ run : vendor/bin/phpunit --coverage-php=coverage/coverage.cov
170120
171121 - name : Upload coverage artifact
172122 uses : actions/upload-artifact@v4
173123 with :
174124 name : coverage-pgsql-${{ matrix.laravel }}-${{ matrix.php }}
175- path : coverage/clover.xml
176-
125+ path : coverage/coverage.cov
177126
178127 test-sqlsrv :
179128 name : Laravel ${{ matrix.laravel }} / PHP ${{ matrix.php }} / MSSQL
180129 runs-on : ubuntu-latest
181130 timeout-minutes : 60
182131 strategy :
183132 matrix :
184- laravel : [ 10, 11, 12 ]
185- php : [ 8.2, 8.3, 8.4 ]
186- exclude :
187- - laravel : 10
188- - laravel : 11
133+ laravel : [ 12 ]
134+ php : [ 8.4 ]
189135
190136 services :
191137 mssql :
@@ -213,12 +159,13 @@ jobs:
213159 steps :
214160 - uses : actions/checkout@v4
215161
216- - name : Install Microsoft ODBC Driver
162+ - name : Install ODBC Drivers
217163 run : |
218164 curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
219165 curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
220166 sudo apt-get update
221- sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17 mssql-tools unixodbc-dev
167+ sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17 mssql-tools
168+ sudo apt-get install -y unixodbc-dev
222169
223170 - name : Set up PHP with SQLSRV
224171 uses : shivammathur/setup-php@v2
@@ -227,72 +174,34 @@ jobs:
227174 extensions : mbstring, pdo_sqlsrv, sqlsrv, zip, exif, intl, gd, bcmath, curl, dom, xdebug
228175 coverage : xdebug
229176
230- - name : Wait for MSSQL
231- run : sleep 30
232-
233- - name : Initialize Database
234- run : |
235- /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P 'Passw0rd1234!' -Q "
236- CREATE DATABASE testing;
237- CREATE LOGIN testuser WITH PASSWORD = 'TestPassw0rd!';
238- CREATE USER testuser FOR LOGIN testuser;
239- ALTER ROLE db_owner ADD MEMBER testuser;"
240-
241- - name : Cache Composer dependencies
242- uses : actions/cache@v3
243- with :
244- path : vendor
245- key : ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }}
246- restore-keys : |
247- ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-
248-
249- - name : Adjust Laravel/Testbench version per matrix
250- run : |
251- composer remove laravel/framework orchestra/testbench --no-update || true
252- composer require laravel/framework:^${{ matrix.laravel }} --no-update
253- composer update --no-interaction --prefer-dist --no-progress
254-
255- - name : Run Tests
256- run : vendor/bin/phpunit --coverage-clover=coverage/clover.xml --path-coverage
177+ - name : Run PHPUnit
178+ run : vendor/bin/phpunit --coverage-php=coverage/coverage.cov
257179
258180 - name : Upload coverage artifact
259181 uses : actions/upload-artifact@v4
260182 with :
261183 name : coverage-sqlsrv-${{ matrix.laravel }}-${{ matrix.php }}
262- path : coverage/clover.xml
263-
184+ path : coverage/coverage.cov
264185
265186 merge-coverage :
266- name : Merge Coverage
187+ name : Merge Coverage Reports
267188 runs-on : ubuntu-latest
268189 needs : [ test-mysql, test-pgsql, test-sqlsrv ]
269-
270190 steps :
271- - uses : actions/checkout@v4
272-
273- - name : Download all coverage artifacts
274- uses : actions/download-artifact@v4
191+ - uses : actions/download-artifact@v4
275192 with :
276193 path : all-coverage
277194
278- - name : Install PHP + phpcov
279- run : |
280- sudo apt-get update
281- sudo apt-get install -y php-cli unzip curl git
282- composer global require phpunit/phpcov
283-
284- - name : Add Composer global bin to PATH
285- run : echo "$HOME/.composer/vendor/bin" >> $GITHUB_PATH
195+ - name : Install phpcov
196+ run : composer global require phpunit/phpcov
286197
287- - name : Merge coverage files
198+ - name : Merge coverage
288199 run : |
289200 mkdir -p coverage
290- find all-coverage -name '*.xml' > coverage-files.txt
291- phpcov merge --clover coverage/clover.xml $(cat coverage-files.txt)
201+ phpcov merge --clover coverage/clover.xml all-coverage/
292202
293-
294- - name : Merge coverage files
295- run : |
296- mkdir -p coverage
297- find all-coverage -name '*.xml' > coverage-files.txt
298- phpcov merge --clover coverage/clover.xml $(cat coverage-files.txt)
203+ - name : Upload merged coverage to qltysh
204+ uses : qltysh/qlty-action/coverage@v1
205+ with :
206+ token : ${{ secrets.QLTY_COVERAGE_TOKEN }}
207+ files : coverage/clover.xml
0 commit comments