|
| 1 | +name: Code Analysis |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: null |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + |
| 9 | +jobs: |
| 10 | + rector_analysis: |
| 11 | + name: Rector analysis |
| 12 | + runs-on: ubuntu-latest |
| 13 | + env: |
| 14 | + PHP_VERSION: 8.4 |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v6 |
| 17 | + |
| 18 | + - uses: shivammathur/setup-php@v2 |
| 19 | + with: |
| 20 | + php-version: ${{ env.PHP_VERSION }} |
| 21 | + extensions: json, mbstring, pdo, curl, pdo_sqlite |
| 22 | + coverage: none |
| 23 | + tools: symfony-cli |
| 24 | + env: |
| 25 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + |
| 27 | + - name: Cache Composer dependencies |
| 28 | + uses: actions/cache@v4 |
| 29 | + with: |
| 30 | + path: /tmp/composer-cache |
| 31 | + key: ${{ runner.os }}-${{ env.PHP_VERSION }}-${{ hashFiles('**/composer.json') }} |
| 32 | + - uses: php-actions/composer@v6 |
| 33 | + with: |
| 34 | + php_version: ${{ env.PHP_VERSION }} |
| 35 | + |
| 36 | + - run: vendor/bin/rector process -n --no-progress-bar --ansi |
| 37 | + |
| 38 | + code_analysis: |
| 39 | + strategy: |
| 40 | + fail-fast: false |
| 41 | + matrix: |
| 42 | + php-version: [ '8.2', '8.3', '8.4' ] |
| 43 | + actions: |
| 44 | + - name: Coding Standard |
| 45 | + # tip: add "--ansi" to commands in CI to make them full of colors |
| 46 | + run: vendor/bin/ecs check src --ansi |
| 47 | + |
| 48 | + - name: PHPStan |
| 49 | + run: vendor/bin/phpstan analyse --ansi |
| 50 | + |
| 51 | + - name: Check composer.json and composer.lock |
| 52 | + run: composer validate --strict --ansi |
| 53 | + |
| 54 | + name: ${{ matrix.actions.name }} - PHP ${{ matrix.php-version }} |
| 55 | + runs-on: ubuntu-latest |
| 56 | + |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v6 |
| 59 | + # see https://github.com/shivammathur/setup-php |
| 60 | + - uses: shivammathur/setup-php@v2 |
| 61 | + with: |
| 62 | + # test the lowest version, to make sure checks pass on it |
| 63 | + php-version: ${{ matrix.php-version }} |
| 64 | + extensions: json, mbstring, pdo, curl, pdo_sqlite |
| 65 | + coverage: none |
| 66 | + tools: symfony-cli |
| 67 | + env: |
| 68 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 69 | + |
| 70 | + - name: Cache Composer dependencies |
| 71 | + uses: actions/cache@v4 |
| 72 | + with: |
| 73 | + path: /tmp/composer-cache |
| 74 | + key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }} |
| 75 | + - uses: php-actions/composer@v6 |
| 76 | + with: |
| 77 | + php_version: ${{ matrix.php-version }} |
| 78 | + |
| 79 | + - run: ${{ matrix.actions.run }} |
0 commit comments