Skip to content

Fix compatibility 2 4 6 #3

Fix compatibility 2 4 6

Fix compatibility 2 4 6 #3

name: 'Static Analysis'
on:
pull_request: ~
push:
branches:
- 'master'
jobs:
static-analysis:
runs-on: 'ubuntu-latest'
strategy:
matrix:
php-version:
- '8.1'
steps:
- name: 'Checkout'
uses: 'actions/checkout@v3'
- name: 'Install PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php-version }}'
coverage: 'none'
tools: 'composer:v2'
env:
COMPOSER_AUTH_JSON: |
{
"http-basic": {
"repo.magento.com": {
"username": "${{ secrets.MAGENTO_USERNAME }}",
"password": "${{ secrets.MAGENTO_PASSWORD }}"
}
}
}
- name: 'Get composer cache directory'
id: 'composer-cache'
run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'
- name: 'Cache dependencies'
uses: 'actions/cache@v3'
with:
path: '${{ steps.composer-cache.outputs.dir }}'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: '${{ runner.os }}-composer-'
- name: 'Install dependencies'
run: 'composer install --prefer-dist'
- name: 'Run composer audit'
run: 'composer audit --format=plain'
- name: 'Run Parallel Lint'
run: 'vendor/bin/parallel-lint --exclude vendor .'
- name: 'Run PHP CodeSniffer'
run: 'vendor/bin/phpcs --extensions=php,phtml'
- name: 'Run PHPMD'
run: 'vendor/bin/phpmd . xml phpmd.xml.dist'
- name: 'Run PHPStan'
run: 'vendor/bin/phpstan analyse'