Parcourir la source

ci: add PHP 8.5 to matrix, extract Psalm job, drop scrutinizer upload

- extend the test matrix with PHP 8.5 and disable fail-fast.
- move Psalm into a dedicated job pinned to PHP 8.4 (Psalm 4 crashes on
  newer runtimes; a Psalm 6 migration needs its own pass).
- drop the Scrutinizer coverage upload and pcov: the service is dead.
  Coverage stays available via the test:coverage composer script.
Ne-Lexa il y a 3 semaines
Parent
commit
b2cce42a4f
1 fichiers modifiés avec 28 ajouts et 19 suppressions
  1. 28 19
      .github/workflows/build.yml

+ 28 - 19
.github/workflows/build.yml

@@ -11,10 +11,10 @@ jobs:
         env:
             extensions:       bz2, dom, iconv, fileinfo, openssl, xml, zlib
             key:              cache-v1
-            PHPUNIT_COVERAGE: 0
             PHP_INI:          date.timezone=UTC, memory_limit=-1, opcache.enable=1, opcache.enable_cli=1
 
         strategy:
+            fail-fast: false
             matrix:
                 os:
                     - ubuntu-latest
@@ -27,6 +27,7 @@ jobs:
                     - '8.2'
                     - '8.3'
                     - '8.4'
+                    - '8.5'
 
         runs-on: ${{ matrix.os }}
 
@@ -66,9 +67,8 @@ jobs:
                 with:
                     php-version: ${{ matrix.php }}
                     extensions:  ${{ env.extensions }}
-                    coverage:    pcov
                     ini-values:  ${{ env.PHP_INI }}
-                    tools:       composer:v2, cs2pr
+                    tools:       composer:v2
 
             -
                 name: Determine composer cache directory on Linux or MacOS
@@ -80,11 +80,6 @@ jobs:
                 if:   matrix.os == 'windows-latest'
                 run:  echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
 
-            -
-                name: Set coverage args
-                if:   matrix.os == 'ubuntu-latest' && matrix.php == '7.4'
-                run:  echo "PHPUNIT_COVERAGE=1" >> $GITHUB_ENV
-
             -
                 name: Cache composer dependencies
                 uses: actions/cache@v4
@@ -115,21 +110,35 @@ jobs:
 
             -
                 name: Run tests with phpunit
-                if:   env.PHPUNIT_COVERAGE == 0
                 run:  vendor/bin/phpunit -v --testsuite "all_tests" --group small,medium,large
 
+    static-analysis:
+        name:    Static analysis (Psalm)
+
+        runs-on: ubuntu-latest
+
+        env:
+            extensions:       bz2, dom, iconv, fileinfo, openssl, xml, zlib
+            PHP_INI:          date.timezone=UTC, memory_limit=-1
+
+        steps:
+            -
+                name: Checkout
+                uses: actions/checkout@v4
+
             -
-                name: Run tests with phpunit and coverage
-                if:   env.PHPUNIT_COVERAGE == 1
-                run:  vendor/bin/phpunit -v --coverage-clover=coverage.clover --testsuite "all_tests" --group small,medium,large
+                name: Install PHP with extensions
+                uses: shivammathur/setup-php@v2
+                with:
+                    php-version: '8.4'
+                    extensions:  ${{ env.extensions }}
+                    ini-values:  ${{ env.PHP_INI }}
+                    tools:       composer:v2
 
             -
-                name: Static analysis
-                run:  vendor/bin/psalm --shepherd --stats --output-format=checkstyle | cs2pr --graceful-warnings --colorize
+                name: Install dependencies with composer
+                run:  composer update --prefer-dist --no-interaction --no-progress --ansi
 
             -
-                name: Upload code coverage scrutinizer
-                if:   env.PHPUNIT_COVERAGE == 1
-                run:  |
-                      wget https://scrutinizer-ci.com/ocular.phar
-                      php ocular.phar code-coverage:upload --format=php-clover coverage.clover
+                name: Run Psalm
+                run:  vendor/bin/psalm --output-format=github