Update Stream #140
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHP Composer | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build-php: | |
name: Prepare PHP | |
runs-on: ${{ matrix.image }} | |
strategy: | |
matrix: | |
image: [ubuntu-20.04] | |
php: ["8.2"] | |
steps: | |
- name: Build and prepare PHP cache | |
uses: pmmp/setup-php-action@2.0.0 | |
with: | |
php-version: ${{ matrix.php }} | |
install-path: "./bin" | |
build: | |
name: PHPStan analysis | |
needs: build-php | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: ["8.2"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: pmmp/setup-php-action@2.0.0 | |
with: | |
php-version: ${{ matrix.php }} | |
install-path: "./bin" | |
pm-version-major: "5" | |
- name: Update Composer | |
run: composer update | |
- name: Install Composer | |
run: curl -sS https://getcomposer.org/installer | php | |
- name: Restore Composer package cache | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: "~/.cache/composer" | |
key: "php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}" | |
restore-keys: | | |
composer-v2-cache- | |
- name: Install PHPStan Composer dependencies | |
run: composer install --prefer-dist --no-interaction --ignore-platform-reqs | |
- name: Run PHPStan | |
run: vendor/bin/phpstan analyze |