1616 strategy :
1717 fail-fast : false
1818 matrix :
19- laravel : [10, 11, 12]
20- php : [8.2, 8.3, 8.4]
21- mysql : [5.7, 8.0]
19+ laravel : [ 10, 11, 12 ]
20+ php : [ 8.2, 8.3, 8.4 ]
21+ mysql : [ 5.7, 8.0 ]
2222
2323 exclude :
2424 - laravel : 10
6060 extensions : mbstring, pdo_mysql, zip, exif, intl, gd, bcmath, curl, dom, xdebug
6161 coverage : xdebug
6262
63- - name : Debug info
64- run : |
65- php -v
66- composer --version
67- mysql --version || true
68-
6963 - name : Wait for MySQL
7064 run : |
7165 for i in {30..0}; do
7670 echo "Waiting for MySQL ($i)..."
7771 sleep 1
7872 done
73+
7974 - name : Cache Composer dependencies
8075 uses : actions/cache@v3
8176 with :
@@ -86,20 +81,18 @@ jobs:
8681
8782 - name : Adjust Laravel/Testbench version per matrix
8883 run : |
89- composer remove laravel/framework orchestra/testbench --no-update || true
90- composer require laravel/framework:^${{ matrix.laravel }} --no-update
91- composer update --no-interaction --prefer-dist --no-progress
92-
93- - name : Ensure coverage directory exists
94- run : mkdir -p coverage
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
9587
9688 - name : Run Tests
9789 run : vendor/bin/phpunit --coverage-clover=coverage/clover.xml --path-coverage
9890
99- - uses : qltysh/qlty-action/coverage@v1
91+ - name : Upload coverage artifact
92+ uses : actions/upload-artifact@v4
10093 with :
101- token : ${{ secrets.QLTY_COVERAGE_TOKEN }}
102- files : coverage/clover.xml
94+ name : coverage-mysql- ${{ matrix.laravel }}-${{ matrix.php }}-${{ matrix.mysql }}
95+ path : coverage/clover.xml
10396
10497
10598 test-pgsql :
@@ -108,9 +101,8 @@ jobs:
108101 timeout-minutes : 60
109102 strategy :
110103 matrix :
111- laravel : [10, 11, 12]
112- php : [8.2, 8.3, 8.4]
113-
104+ laravel : [ 10, 11, 12 ]
105+ php : [ 8.2, 8.3, 8.4 ]
114106 exclude :
115107 - laravel : 10
116108 php : 8.4
@@ -138,7 +130,6 @@ jobs:
138130 DB_DATABASE : testing
139131 DB_CONNECTION : ' pgsql'
140132
141-
142133 steps :
143134 - uses : actions/checkout@v4
144135
@@ -149,12 +140,6 @@ jobs:
149140 extensions : mbstring, pdo_pgsql, zip, exif, intl, gd, bcmath, curl, dom, xdebug
150141 coverage : xdebug
151142
152- - name : Debug info
153- run : |
154- php -v
155- composer --version
156- psql --version || true
157-
158143 - name : Wait for Postgres
159144 run : |
160145 for i in {30..0}; do
@@ -165,40 +150,39 @@ jobs:
165150 echo "Waiting for Postgres ($i)..."
166151 sleep 1
167152 done
153+
168154 - name : Cache Composer dependencies
169155 uses : actions/cache@v3
170156 with :
171157 path : vendor
172158 key : ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }}
173159 restore-keys : |
174160 ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-
161+
175162 - name : Adjust Laravel/Testbench version per matrix
176163 run : |
177- composer remove laravel/framework orchestra/testbench --no-update || true
178- composer require laravel/framework:^${{ matrix.laravel }} --no-update
179- composer update --no-interaction --prefer-dist --no-progress
180-
181- - name : Ensure coverage directory exists
182- run : mkdir -p coverage
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
183167
184168 - name : Run Tests
185169 run : vendor/bin/phpunit --coverage-clover=coverage/clover.xml --path-coverage
186170
187- - uses : qltysh/qlty-action/coverage@v1
171+ - name : Upload coverage artifact
172+ uses : actions/upload-artifact@v4
188173 with :
189- token : ${{ secrets.QLTY_COVERAGE_TOKEN }}
190- files : coverage/clover.xml
174+ name : coverage-pgsql- ${{ matrix.laravel }}-${{ matrix.php }}
175+ path : coverage/clover.xml
191176
192177
193178 test-sqlsrv :
194- name : Laravel ${{ matrix.laravel }} / PHP ${{ matrix.php }} / MSSQL 2022-latest
179+ name : Laravel ${{ matrix.laravel }} / PHP ${{ matrix.php }} / MSSQL
195180 runs-on : ubuntu-latest
196181 timeout-minutes : 60
197182 strategy :
198183 matrix :
199- laravel : [10, 11, 12]
200- php : [8.2, 8.3, 8.4]
201-
184+ laravel : [ 10, 11, 12 ]
185+ php : [ 8.2, 8.3, 8.4 ]
202186 exclude :
203187 - laravel : 10
204188 - laravel : 11
@@ -229,15 +213,12 @@ jobs:
229213 steps :
230214 - uses : actions/checkout@v4
231215
232- - name : Install Microsoft ODBC Driver for SQL Server (Linux)
216+ - name : Install Microsoft ODBC Driver
233217 run : |
234218 curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
235219 curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
236220 sudo apt-get update
237- sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17 mssql-tools
238- sudo apt-get install -y unixodbc-dev
239- echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
240- source ~/.bashrc
221+ sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17 mssql-tools unixodbc-dev
241222
242223 - name : Set up PHP with SQLSRV
243224 uses : shivammathur/setup-php@v2
@@ -246,16 +227,8 @@ jobs:
246227 extensions : mbstring, pdo_sqlsrv, sqlsrv, zip, exif, intl, gd, bcmath, curl, dom, xdebug
247228 coverage : xdebug
248229
249- - name : Debug info
250- run : |
251- php -v
252- composer --version
253- /opt/mssql-tools/bin/sqlcmd -? || true
254-
255230 - name : Wait for MSSQL
256- run : |
257- echo "Waiting 30 seconds for MSSQL to start..."
258- sleep 30
231+ run : sleep 30
259232
260233 - name : Initialize Database
261234 run : |
@@ -279,13 +252,43 @@ jobs:
279252 composer require laravel/framework:^${{ matrix.laravel }} --no-update
280253 composer update --no-interaction --prefer-dist --no-progress
281254
282- - name : Ensure coverage directory exists
283- run : mkdir -p coverage
284-
285255 - name : Run Tests
286256 run : vendor/bin/phpunit --coverage-clover=coverage/clover.xml --path-coverage
287257
288- - uses : qltysh/qlty-action/coverage@v1
258+ - name : Upload coverage artifact
259+ uses : actions/upload-artifact@v4
260+ with :
261+ name : coverage-sqlsrv-${{ matrix.laravel }}-${{ matrix.php }}
262+ path : coverage/clover.xml
263+
264+
265+ merge-coverage :
266+ name : Merge Coverage
267+ runs-on : ubuntu-latest
268+ needs : [ test-mysql, test-pgsql, test-sqlsrv ]
269+
270+ steps :
271+ - uses : actions/checkout@v4
272+
273+ - name : Download all coverage artifacts
274+ uses : actions/download-artifact@v4
275+ with :
276+ path : all-coverage
277+
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 : Merge coverage files
285+ run : |
286+ mkdir -p coverage
287+ find all-coverage -name '*.xml' > coverage-files.txt
288+ phpcov merge --clover coverage/clover.xml $(cat coverage-files.txt)
289+
290+ - name : Upload merged coverage to Qlty
291+ uses : qltysh/qlty-action/coverage@v1
289292 with :
290293 token : ${{ secrets.QLTY_COVERAGE_TOKEN }}
291294 files : coverage/clover.xml
0 commit comments