Skip to content

Commit

Permalink
Move lint to own CI task
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Jul 25, 2024
1 parent 68328db commit fe9eb29
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 32 deletions.
24 changes: 0 additions & 24 deletions .env.dist

This file was deleted.

34 changes: 28 additions & 6 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

env:
DATABASE_URL: mysql://root:root@127.0.0.1:3306/sulu_test?serverVersion=5.7
DATABASE_URL: mysql://root:root@127.0.0.1:3306/sulu_test?serverVersion=8.0

strategy:
fail-fast: false
Expand Down Expand Up @@ -96,11 +96,33 @@ jobs:
run: composer initialize
env: ${{ matrix.env }}

- name: Lint code
if: ${{ matrix.lint }}
run: composer lint
env: ${{ matrix.env }}

- name: Execute test cases
run: time composer test -- --config ${{ matrix.phpunit-config || 'phpunit.xml.dist' }}
env: ${{ matrix.env }}

lint:
name: "PHP Lint"
runs-on: ubuntu-latest

env:
DATABASE_URL: mysql://root:root@127.0.0.1:3306/sulu_test?serverVersion=8.0

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

- name: Install and configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: highest

- name: Lint code
run: composer lint
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
"@php-cs"
],
"phpunit": "vendor/bin/phpunit",
"phpstan": "vendor/bin/phpstan analyze -c ./phpstan.neon . -l 5",
"phpstan": [
"Tests/Application/console cache:warmup --env dev",
"vendor/bin/phpstan analyze -c ./phpstan.neon . -l 5"
],
"php-cs": "vendor/bin/php-cs-fixer fix --verbose --diff --dry-run",
"php-cs-fix": "vendor/bin/php-cs-fixer fix"
}
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ includes:
parameters:
paths:
- .
excludes_analyse:
excludePaths:
- %currentWorkingDirectory%/DependencyInjection/Configuration.php
- %currentWorkingDirectory%/EventSubscriber/AutoLoginSubscriber.php
- %currentWorkingDirectory%/Middleware/EventMiddleware.php
Expand Down

0 comments on commit fe9eb29

Please # to comment.