Skip to content

Commit

Permalink
Add better CI for CS (#5)
Browse files Browse the repository at this point in the history
* Add better CI for CS

* normalize
  • Loading branch information
Nyholm authored Jun 11, 2021
1 parent 7e8b096 commit ee66cdb
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 19 deletions.
73 changes: 59 additions & 14 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,82 @@
on: [push, pull_request]
name: Static analysis

on:
pull_request: ~

jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

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

- name: PHPStan
uses: docker://oskarstark/phpstan-ga
env:
REQUIRE_DEV: true
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
args: analyze --no-progress
php-version: 8.0
coverage: none
tools: phpstan:0.12.88, cs2pr

- name: Download dependencies
uses: ramsey/composer-install@v1

- name: PHPStan
run: phpstan analyze --no-progress --error-format=checkstyle | cs2pr

php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
args: --dry-run --diff-format udiff
php-version: 8.0
coverage: none
tools: php-cs-fixer:2.19.0, cs2pr

- name: PHP-CS-Fixer
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr

psalm:
name: Psalm
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none
tools: vimeo/psalm:4.7.2

- name: Download dependencies
uses: ramsey/composer-install@v1

- name: Psalm
uses: docker://vimeo/psalm-github-actions
run: psalm --no-progress --output-format=github

composer-normalize:
name: Composer Normalize
runs-on: ubuntu-20.04

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
tools: composer-normalize

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

- name: Normalize
run: composer-normalize --dry-run
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
],
"require": {
"php": ">=7.2",
"symfony/config": "^4.4 || ^5.3 | ^6.0",
"symfony/dependency-injection": "^4.4 || ^5.3 | ^6.0",
"symfony/http-kernel": "^4.4 || ^5.3 | ^6.0",
"symfony/http-foundation": "^4.4 || ^5.3 | ^6.0",
"symfony/config": "^4.4 || ^5.3 || ^6.0",
"symfony/dependency-injection": "^4.4 || ^5.3 || ^6.0",
"symfony/http-foundation": "^4.4 || ^5.3 || ^6.0",
"symfony/http-kernel": "^4.4 || ^5.3 || ^6.0",
"twig/twig": "^2.12.5 || ^3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.4 || ^5.3 | ^6.0"
"symfony/phpunit-bridge": "^4.4 || ^5.3 || ^6.0"
},
"config": {
"sort-packages": true
Expand Down

0 comments on commit ee66cdb

Please sign in to comment.