move thecodingmachine/phpstan-safe-rule #17
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: Continuous integration | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
check-static-code: | |
name: Check static code (PHP ${{ matrix.php-version }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: [ 8.1, 8.2, 8.3 ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
coverage: none | |
php-version: ${{ matrix.php-version }} | |
tools: cs2pr | |
- name: Get composer cache directory | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Restore composer cache | |
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 composer dependencies | |
run: composer install --no-progress | |
- name: Run PHPStan | |
run: vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr | |
check-code-quality: | |
name: Check code quality (PHP ${{ matrix.php-version }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: [ 8.1, 8.2, 8.3 ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
coverage: none | |
php-version: ${{ matrix.php-version }} | |
- name: Get composer cache directory | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Restore composer cache | |
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 composer dependencies | |
run: composer install --no-progress | |
- name: Run Rector | |
run: vendor/bin/rector --ansi --dry-run | |
check-code-style: | |
name: Check code style (PHP ${{ matrix.php-version }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: [ 8.1, 8.2, 8.3 ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
coverage: none | |
php-version: ${{ matrix.php-version }} | |
tools: cs2pr | |
- name: Install composer dependencies | |
run: composer install --no-progress | |
- name: Run Pint | |
id: pint-test | |
run: vendor/bin/pint --test | |
- name: Run Pint with annotations | |
if: failure() && steps.pint-test.outcome != 'success' | |
run: vendor/bin/pint --format=checkstyle --test | cs2pr |