Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PHP CS Fixer to Github Actions #6

Merged
merged 3 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Coding Standards

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
php-cs-fixer:
name: PHP CS Fixer (PHP ${{ matrix.php-version }})
runs-on: ubuntu-20.04

strategy:
matrix:
php-version:
- '8.0'

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
tools: cs2pr

- name: Install Composer dependencies
uses: ramsey/composer-install@v1

- name: Run PHP CS Fixer
run: 'vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr'
21 changes: 7 additions & 14 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ on:
- main

jobs:
static-analysis-phpstan:
name: Static Analysis with PHPStan
phpstan:
name: PHPStan (PHP ${{ matrix.php-version }})
runs-on: ubuntu-20.04

strategy:
matrix:
php-version:
- "8.0"
- '8.0'

steps:
- name: Checkout code
Expand All @@ -29,15 +29,8 @@ jobs:
php-version: ${{ matrix.php-version }}
tools: cs2pr

- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: Install dependencies with composer
run: "composer install --no-interaction --no-progress --no-suggest"
- name: Install Composer dependencies
uses: ramsey/composer-install@v1

- name: Run a static analysis with phpstan/phpstan
run: "vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr"
- name: Run PHPStan
run: 'vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr'