diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 3091a4c84..fc409f910 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -20,17 +20,39 @@ jobs: - php-version: 8.4 experimental: true composer_args: "--ignore-platform-reqs" + env: + extensions: ast, grpc, protobuf steps: + - name: Set cache key + id: key + run: | + echo "key=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + - uses: actions/checkout@v3 + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ matrix.php-version }} + extensions: ${{ env.extensions }} + key: ${{ env.key }} + + - name: Cache extensions + uses: actions/cache@v3 + with: + path: ${{ steps.extcache.outputs.dir }} + key: ${{ steps.extcache.outputs.key }} + restore-keys: ${{ steps.extcache.outputs.key }} + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} coverage: xdebug tools: php-cs-fixer - extensions: "ast, grpc, protobuf" + extensions: ${{ env.extensions }} - name: Validate composer.json run: composer validate @@ -55,24 +77,30 @@ jobs: run: vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no -vvv - name: Check Dependencies + continue-on-error: ${{ matrix.experimental }} run: vendor/bin/deptrac --formatter=github-actions --report-uncovered - name: Run Phan + continue-on-error: ${{ matrix.experimental }} env: XDEBUG_MODE: off PHAN_DISABLE_XDEBUG_WARN: 1 run: vendor/bin/phan - name: Run Psalm + continue-on-error: ${{ matrix.experimental }} run: vendor/bin/psalm --output-format=github - name: Run Phpstan + continue-on-error: ${{ matrix.experimental }} run: vendor/bin/phpstan analyse --error-format=github - name: Run PHPUnit (unit tests) + continue-on-error: ${{ matrix.experimental }} run: php -dzend.assertions=1 vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover --testsuite unit - name: Run PHPUnit (integration tests) + continue-on-error: ${{ matrix.experimental }} run: vendor/bin/phpunit --testsuite integration - name: Code Coverage