-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
444cc83
commit 2a0e088
Showing
1 changed file
with
82 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
env: | ||
fail-fast: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
operating-system: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ] | ||
php-versions: [ '8.3', '8.4' ] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP with quality tools | ||
uses: shivammathur/setup-php@v2 | ||
|
||
#TODO: extensions and caching if we use them | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
tools: composer, php-cs-fixer, rector, phpstan | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Lint composer | ||
run: composer validate --strict | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist | ||
|
||
- name: Composer normalize | ||
run: composer normalize --dry-run | ||
|
||
- name: Composer audit | ||
run: composer audit | ||
|
||
- name: Lint YAML files | ||
run: php bin/console lint:yaml config/ src/ --parse-tags --env=prod | ||
|
||
- name: Lint Twig templates | ||
run: php bin/console lint:twig templates/ --env=prod | ||
|
||
- name: Lint Parameters and Services | ||
run: php bin/console lint:container --no-debug --env=prod | ||
|
||
- name: Lint Doctrine entities | ||
run: php bin/console doctrine:schema:validate --skip-sync -vvv --no-interaction --env=prod | ||
|
||
- name: Setup PHP Code Quality Tools | ||
run: composer run install-tools | ||
|
||
- name: Lint PHP files (CS) | ||
run: composer run fix-cs -- --dry-run --diff --using-cache=no --stop-on-violation --show-progress=bar | ||
|
||
- name: Static analysis on PHP files | ||
run: composer run phpstan -- -n | ||
|
||
- name: Lint with Rector | ||
run: composer run rector -- -n --no-cache | ||
|
||
#TODO: lint MD files, lint JS & CSS |