1
0
Эх сурвалжийг харах

Run unit and integration PHPUnit suites as separate CI jobs. (#5869)

* Run unit and integration PHPUnit suites as separate CI jobs.

A failure in one suite should still report the other, and deploy should wait until both pass.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Run the split PHPUnit suites on PHP 8.3, 8.4, and 8.5.

Each suite still has its own job, and the package stays a single PHP 8.3 build.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Aleksandr Trofimov 6 өдөр өмнө
parent
commit
87f48707a1
1 өөрчлөгдсөн 13 нэмэгдсэн , 2 устгасан
  1. 13 2
      .github/workflows/ci.yml

+ 13 - 2
.github/workflows/ci.yml

@@ -19,8 +19,17 @@ concurrency:
 
 jobs:
   test:
+    # Units and Integration each get a runner per PHP version. Deploy waits on every leg, and a
+    # failure in one does not cancel the other. The package is built only on the PHP 8.3 Units
+    # leg so it is uploaded once.
+    name: ${{ matrix.suite == 'Units' && 'Unit tests' || 'Integration tests' }} (PHP ${{ matrix.php }})
     if: github.event_name == 'push' || github.event.action != 'closed'
     runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        suite: [Units, Integration]
+        php: ['8.3', '8.4', '8.5']
 
     services:
       mysql:
@@ -44,7 +53,7 @@ jobs:
     - name: Setup PHP
       uses: shivammathur/setup-php@v2
       with:
-        php-version: '8.3'
+        php-version: ${{ matrix.php }}
         extensions: intl, curl, gd, mbstring, zip, exif, pdo_mysql
         ini-values: short_open_tag=On, memory_limit=256M
         tools: composer, phing, phpunit:12
@@ -80,12 +89,14 @@ jobs:
         --server_php_self=/install/index.php
 
     - name: Run PHPUnit
-      run: phpunit -c tests/phpunit.xml
+      run: phpunit -c tests/phpunit.xml --testsuite "${{ matrix.suite }}"
 
     - name: Build package
+      if: success() && matrix.suite == 'Units' && matrix.php == '8.3'
       run: phing package -Dbuild=${{ github.run_number }}
 
     - name: Upload package artifact
+      if: success() && matrix.suite == 'Units' && matrix.php == '8.3'
       uses: actions/upload-artifact@v4
       with:
         name: una-package