|
| 1 | +name: test |
| 2 | +on: |
| 3 | + pull_request: ~ |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + |
| 8 | +jobs: |
| 9 | + test: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + name: test |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + install-args: [''] |
| 15 | + php-version: ['8.1', '8.2', '8.3', '8.4'] |
| 16 | + fail-fast: false |
| 17 | + steps: |
| 18 | + # Cancel previous runs of the same branch |
| 19 | + - name: cancel |
| 20 | + |
| 21 | + with: |
| 22 | + access_token: ${{ github.token }} |
| 23 | + |
| 24 | + - name: checkout |
| 25 | + uses: actions/checkout@v5 |
| 26 | + |
| 27 | + - name: php |
| 28 | + uses: shivammathur/[email protected] |
| 29 | + with: |
| 30 | + php-version: ${{ matrix.php-version }} |
| 31 | + ini-values: zend.assertions=1 |
| 32 | + |
| 33 | + - name: composer-cache-dir |
| 34 | + id: composercache |
| 35 | + run: | |
| 36 | + echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 37 | +
|
| 38 | + - name: composer-cache |
| 39 | + |
| 40 | + with: |
| 41 | + path: ${{ steps.composercache.outputs.dir }} |
| 42 | + key: composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }} |
| 43 | + restore-keys: | |
| 44 | + composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }} |
| 45 | + composer-${{ hashFiles('**/composer.json') }}- |
| 46 | + composer- |
| 47 | +
|
| 48 | + - name: composer |
| 49 | + run: | |
| 50 | + composer update ${{ matrix.install-args }} --no-interaction --no-progress --prefer-dist |
| 51 | +
|
| 52 | + - name: phpcs |
| 53 | + run: | |
| 54 | + vendor/bin/phpcs --no-cache |
| 55 | +
|
| 56 | + - name: phpunit |
| 57 | + run: | |
| 58 | + vendor/bin/phpunit --no-coverage |
| 59 | +
|
| 60 | + - name: phpstan-cache |
| 61 | + |
| 62 | + with: |
| 63 | + key: phpstan-${{ matrix.php-version }}-${{ matrix.install-args }}-${{ github.ref }}-${{ github.sha }} |
| 64 | + path: .phpstan-cache |
| 65 | + restore-keys: | |
| 66 | + phpstan-${{ matrix.php-version }}-${{ matrix.install-args }}-${{ github.ref }}- |
| 67 | + phpstan-${{ matrix.php-version }}-${{ matrix.install-args }}- |
| 68 | + phpstan-${{ matrix.php-version }}- |
| 69 | + phpstan- |
| 70 | +
|
| 71 | + - name: phpstan |
| 72 | + run: | |
| 73 | + mkdir -p .phpstan-cache |
| 74 | + vendor/bin/phpstan analyse --no-progress --no-interaction --memory-limit=1G |
0 commit comments