|
| 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: ['', '--prefer-lowest'] |
| 15 | + php-version: ['7.2', '7.3', '7.4', '8.0'] |
| 16 | + steps: |
| 17 | + # Cancel previous runs of the same branch |
| 18 | + - name: cancel |
| 19 | + |
| 20 | + with: |
| 21 | + access_token: ${{ github.token }} |
| 22 | + |
| 23 | + - name: checkout |
| 24 | + uses: actions/checkout@v2 |
| 25 | + |
| 26 | + - name: php |
| 27 | + uses: shivammathur/[email protected] |
| 28 | + with: |
| 29 | + php-version: ${{ matrix.php-version }} |
| 30 | + |
| 31 | + - name: composer-cache-dir |
| 32 | + id: composercache |
| 33 | + run: | |
| 34 | + echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 35 | +
|
| 36 | + - name: composer-cache |
| 37 | + |
| 38 | + with: |
| 39 | + path: ${{ needs.prepare.outputs.composercachedir }} |
| 40 | + key: composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }} |
| 41 | + restore-keys: | |
| 42 | + composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }} |
| 43 | + composer-${{ hashFiles('**/composer.json') }}- |
| 44 | + composer- |
| 45 | +
|
| 46 | + - name: composer |
| 47 | + run: | |
| 48 | + composer check-platform-reqs --no-interaction |
| 49 | + composer update ${{ matrix.install-args }} --no-interaction --no-progress --prefer-dist |
| 50 | +
|
| 51 | + - name: phpunit |
| 52 | + run: | |
| 53 | + vendor/bin/phpunit |
| 54 | +
|
| 55 | + - name: phpstan-cache |
| 56 | + |
| 57 | + with: |
| 58 | + key: phpstan-${{ github.ref }}-${{ matrix.php-version }}-${{ matrix.install-args }}-${{ github.sha }} |
| 59 | + path: .phpstan-cache |
| 60 | + restore-keys: | |
| 61 | + phpstan-${{ github.ref }}-${{ matrix.php-version }}-${{ matrix.install-args }}- |
| 62 | + phpstan-${{ github.ref }}-${{ matrix.php-version }}- |
| 63 | + phpstan-${{ github.ref }}- |
| 64 | + phpstan- |
| 65 | +
|
| 66 | + - name: phpstan |
| 67 | + run: | |
| 68 | + mkdir -p .phpstan-cache |
| 69 | + APP_ENV=dev bin/console cache:clear |
| 70 | + vendor/bin/phpstan analyse --no-progress --no-interaction --memory-limit=1G |
0 commit comments