|
| 1 | +name: "Lint" |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +env: |
| 6 | + fail-fast: true |
| 7 | + |
| 8 | +jobs: |
| 9 | + php-cs-fixer: |
| 10 | + name: PHP-CS-Fixer |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: "Checkout code" |
| 14 | + uses: actions/checkout@v2 |
| 15 | + |
| 16 | + - name: PHP-CS-Fixer |
| 17 | + uses: docker://oskarstark/php-cs-fixer-ga |
| 18 | + with: |
| 19 | + args: --diff --dry-run |
| 20 | + |
| 21 | + linters: |
| 22 | + name: Linters |
| 23 | + runs-on: ubuntu-latest |
| 24 | + strategy: |
| 25 | + matrix: |
| 26 | + php-version: ['7.4'] |
| 27 | + |
| 28 | + steps: |
| 29 | + - name: "Checkout code" |
| 30 | + |
| 31 | + |
| 32 | + - name: "Install PHP with extensions" |
| 33 | + uses: shivammathur/[email protected] |
| 34 | + with: |
| 35 | + coverage: "none" |
| 36 | + extensions: intl |
| 37 | + php-version: ${{ matrix.php-version }} |
| 38 | + tools: composer:v2 |
| 39 | + |
| 40 | + - name: "Set composer cache directory" |
| 41 | + id: composer-cache |
| 42 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 43 | + |
| 44 | + - name: "Cache composer" |
| 45 | + |
| 46 | + with: |
| 47 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 48 | + key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }} |
| 49 | + restore-keys: ${{ runner.os }}-${{ matrix.php-version }}-composer- |
| 50 | + |
| 51 | + - name: "Require symfony/flex" |
| 52 | + run: composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-main |
| 53 | + |
| 54 | + - name: "Composer update" |
| 55 | + id: install |
| 56 | + run: composer update --no-scripts |
| 57 | + |
| 58 | + - name: Lint YAML files |
| 59 | + if: always() && steps.install.outcome == 'success' |
| 60 | + run: ./bin/console lint:yaml config --parse-tags |
| 61 | + |
| 62 | + - name: Lint Twig templates |
| 63 | + if: always() && steps.install.outcome == 'success' |
| 64 | + run: ./bin/console lint:twig templates --env=prod |
| 65 | + |
| 66 | + - name: Lint XLIFF translations |
| 67 | + if: always() && steps.install.outcome == 'success' |
| 68 | + run: ./bin/console lint:xliff translations |
| 69 | + |
| 70 | + - name: Lint Parameters and Services |
| 71 | + if: always() && steps.install.outcome == 'success' |
| 72 | + run: ./bin/console lint:container |
| 73 | + |
| 74 | + - name: Lint Doctrine entities |
| 75 | + if: always() && steps.install.outcome == 'success' |
| 76 | + run: ./bin/console doctrine:schema:validate --skip-sync -vvv --no-interaction |
| 77 | + |
| 78 | + - name: Lint Composer config |
| 79 | + if: always() && steps.install.outcome == 'success' |
| 80 | + run: composer validate --strict |
| 81 | + |
| 82 | + - name: Download Symfony CLI |
| 83 | + if: always() && steps.install.outcome == 'success' |
| 84 | + run: wget https://get.symfony.com/cli/installer -O - | bash |
| 85 | + |
| 86 | + - name: Check if any dependencies are compromised |
| 87 | + if: always() && steps.install.outcome == 'success' |
| 88 | + run: /home/runner/.symfony/bin/symfony check:security |
0 commit comments