Skip to content

Make php-coding-standard Laravel 11 ready #72

Make php-coding-standard Laravel 11 ready

Make php-coding-standard Laravel 11 ready #72

Workflow file for this run

name: phpcstd
on:
push:
pull_request:
env:
extensions: ast
key: ext-cache-v1
jobs:
phpunit:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.1, 8.2, 8.3]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/cache@v4
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 }}
extensions: ${{ env.extensions }}
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-composer-
- name: Install dependencies
run: composer install
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Run tests
run: vendor/bin/phpunit
phpcstd:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [
7.4,
8.0,
8.1,
8.2,
8.3,
]
tool: [
composer-normalize,
deptrac,
ecs,
parallel-lint,
phan,
php_codesniffer,
phpmd,
phpstan,
psalm,
rector,
]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/cache@v4
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 }}
coverage: none
extensions: ${{ env.extensions }}
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-composer-
- name: Install dependencies
run: composer install
- name: Enable all tools
run: sed -i -e 's/enabled = false/enabled = true/g' .phpcstd.dist.ini
- name: Run phpcstd (in no-fail mode)
run: php bin/phpcstd --ci -vvv --only=${{ matrix.tool }} --no-fail