Php 8 #5
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: "Validate" | |
on: | |
pull_request: | |
jobs: | |
composer-json-lint: | |
name: "Lint composer.json" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "7.4" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
tools: composer:v2, composer-normalize, composer-require-checker, composer-unused | |
- name: "Get composer cache directory" | |
id: composercache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: "Cache dependencies" | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composercache.outputs.dir }} | |
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress" | |
- name: "Validate composer.json" | |
run: "composer validate --strict" | |
- name: "Normalize composer.json" | |
run: "composer-normalize --dry-run" | |
- name: "Check composer.json explicit dependencies" | |
run: "composer-require-checker check" | |
- name: "Check composer.json unused dependencies" | |
run: "composer-unused" | |
phpcs: | |
name: "phpcs" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "7.4" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
tools: composer:v2, cs2pr | |
- name: "Get composer cache directory" | |
id: composercache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: "Cache dependencies" | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composercache.outputs.dir }} | |
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress" | |
- name: "Check coding standards" | |
run: "vendor/bin/phpcs -q --report=checkstyle | cs2pr" | |
phpstan: | |
name: "phpstan" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "7.4" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
tools: composer:v2, cs2pr | |
- name: "Get composer cache directory" | |
id: composercache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: "Cache dependencies" | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composercache.outputs.dir }} | |
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress" | |
- name: "Run static analysis" | |
run: "vendor/bin/phpstan analyse --no-progress --error-format=checkstyle | cs2pr" | |
psalm: | |
name: "psalm" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "7.4" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
tools: composer:v2, cs2pr | |
- name: "Get composer cache directory" | |
id: composercache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: "Cache dependencies" | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composercache.outputs.dir }} | |
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- | |
- name: "Install dependencies" | |
run: "composer update --no-interaction --no-progress" | |
- name: "Run static analysis" | |
run: "vendor/bin/psalm --output-format=github" |