|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + name: Tests (PHP ${{ matrix.php-version }}, PHPStan ${{ matrix.phpstan-version }}) |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + php-version: [8.2, 8.3] |
| 18 | + phpstan-version: ['2.0.*', '^2.1'] |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Setup PHP |
| 24 | + uses: shivammathur/setup-php@v2 |
| 25 | + with: |
| 26 | + php-version: ${{ matrix.php-version }} |
| 27 | + extensions: dom, curl, libxml, mbstring, zip |
| 28 | + coverage: none |
| 29 | + |
| 30 | + - name: Cache Composer packages |
| 31 | + id: composer-cache |
| 32 | + uses: actions/cache@v3 |
| 33 | + with: |
| 34 | + path: vendor |
| 35 | + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} |
| 36 | + restore-keys: | |
| 37 | + ${{ runner.os }}-php- |
| 38 | +
|
| 39 | + - name: Install dependencies |
| 40 | + run: composer install --prefer-dist --no-progress |
| 41 | + |
| 42 | + - name: Install specific PHPStan version |
| 43 | + run: composer require --dev "phpstan/phpstan:${{ matrix.phpstan-version }}" --no-update && composer update phpstan/phpstan |
| 44 | + |
| 45 | + - name: Execute tests via Pest |
| 46 | + run: vendor/bin/pest |
| 47 | + |
| 48 | + pint: |
| 49 | + name: Code Style (Pint) |
| 50 | + runs-on: ubuntu-latest |
| 51 | + |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v4 |
| 54 | + |
| 55 | + - name: Setup PHP |
| 56 | + uses: shivammathur/setup-php@v2 |
| 57 | + with: |
| 58 | + php-version: 8.3 |
| 59 | + extensions: dom, curl, libxml, mbstring, zip |
| 60 | + coverage: none |
| 61 | + |
| 62 | + - name: Cache Composer packages |
| 63 | + id: composer-cache |
| 64 | + uses: actions/cache@v3 |
| 65 | + with: |
| 66 | + path: vendor |
| 67 | + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} |
| 68 | + restore-keys: | |
| 69 | + ${{ runner.os }}-php- |
| 70 | +
|
| 71 | + - name: Install dependencies |
| 72 | + run: composer install --prefer-dist --no-progress |
| 73 | + |
| 74 | + - name: Run Pint |
| 75 | + run: vendor/bin/pint --test |
| 76 | + |
| 77 | + phpstan: |
| 78 | + name: Static Analysis (PHPStan) |
| 79 | + runs-on: ubuntu-latest |
| 80 | + |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@v4 |
| 83 | + |
| 84 | + - name: Setup PHP |
| 85 | + uses: shivammathur/setup-php@v2 |
| 86 | + with: |
| 87 | + php-version: 8.3 |
| 88 | + extensions: dom, curl, libxml, mbstring, zip |
| 89 | + coverage: none |
| 90 | + |
| 91 | + - name: Cache Composer packages |
| 92 | + id: composer-cache |
| 93 | + uses: actions/cache@v3 |
| 94 | + with: |
| 95 | + path: vendor |
| 96 | + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} |
| 97 | + restore-keys: | |
| 98 | + ${{ runner.os }}-php- |
| 99 | +
|
| 100 | + - name: Install dependencies |
| 101 | + run: composer install --prefer-dist --no-progress |
| 102 | + |
| 103 | + - name: Run PHPStan |
| 104 | + run: vendor/bin/phpstan analyze |
0 commit comments