Merge pull request #1017 from AJenbo/phpstan-ci #29
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: Codestyle | |
on: | |
push: | |
branches: | |
- "*" | |
paths: | |
- '**.php' | |
- 'composer.json' | |
- 'phpcs.xml.dist' | |
- '.github/workflows/codestyle.yml' | |
pull_request: | |
branches: | |
- "*" | |
paths: | |
- '**.php' | |
- 'composer.json' | |
- 'phpcs.xml.dist' | |
- '.github/workflows/codestyle.yml' | |
jobs: | |
php-tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
env: | |
COMPOSER_NO_INTERACTION: 1 | |
strategy: | |
matrix: | |
php: [7.4] | |
dependency-version: [prefer-stable] | |
name: Codestyle check | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: none | |
tools: composer:v2 | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.dependency-version }}-${{ hashFiles('**/composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.dependency-version }} | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: Run PHPCS for the codestyle | |
run: vendor/bin/phpcs |