|
| 1 | +name: Static Analysis |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: read |
| 5 | + pull-requests: write |
| 6 | + |
| 7 | +on: [push] |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + phpstan: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout code |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Setup PHP |
| 22 | + uses: shivammathur/setup-php@v2 |
| 23 | + with: |
| 24 | + php-version: 8.3 |
| 25 | + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo |
| 26 | + |
| 27 | + - name: Get Composer Cache Directory |
| 28 | + id: composer-cache |
| 29 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 30 | + |
| 31 | + - name: Cache Composer dependencies |
| 32 | + uses: actions/cache@v4 |
| 33 | + with: |
| 34 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 35 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 36 | + restore-keys: | |
| 37 | + ${{ runner.os }}-composer- |
| 38 | +
|
| 39 | + - name: Install dependencies |
| 40 | + run: composer install --prefer-dist --no-interaction --no-progress |
| 41 | + |
| 42 | + - name: Cache phpstan results |
| 43 | + uses: actions/cache@v4 |
| 44 | + with: |
| 45 | + path: .phpstan-cache |
| 46 | + key: "result-cache-${{ github.run_id }}" # always write a new cache |
| 47 | + restore-keys: | |
| 48 | + result-cache- |
| 49 | +
|
| 50 | + - name: Run phpstan |
| 51 | + run: vendor/bin/phpstan analyse -c phpstan.dist.neon --no-progress --error-format=github |
| 52 | + |
| 53 | + type-coverage: |
| 54 | + runs-on: ubuntu-latest |
| 55 | + steps: |
| 56 | + - name: Checkout code |
| 57 | + uses: actions/checkout@v4 |
| 58 | + |
| 59 | + - name: Setup PHP |
| 60 | + uses: shivammathur/setup-php@v2 |
| 61 | + with: |
| 62 | + php-version: 8.3 |
| 63 | + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo |
| 64 | + |
| 65 | + - name: Get Composer Cache Directory |
| 66 | + id: composer-cache |
| 67 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 68 | + |
| 69 | + - name: Cache Composer dependencies |
| 70 | + uses: actions/cache@v4 |
| 71 | + with: |
| 72 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 73 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 74 | + restore-keys: | |
| 75 | + ${{ runner.os }}-composer- |
| 76 | +
|
| 77 | + - name: Install dependencies |
| 78 | + run: composer install --prefer-dist --no-interaction --no-progress |
| 79 | + |
| 80 | + - name: Check type coverage |
| 81 | + run: vendor/bin/pest --type-coverage --min=100 |
0 commit comments