|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +jobs: |
| 7 | + static-analysis-phpstan: |
| 8 | + name: "Static Analysis with PHPStan" |
| 9 | + runs-on: "ubuntu-latest" |
| 10 | + |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + php-version: |
| 14 | + - "7.4" |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: "Checkout code" |
| 18 | + uses: "actions/checkout@v2" |
| 19 | + |
| 20 | + - name: "Install PHP" |
| 21 | + uses: "shivammathur/setup-php@v2" |
| 22 | + with: |
| 23 | + coverage: "none" |
| 24 | + php-version: "${{ matrix.php-version }}" |
| 25 | + tools: cs2pr |
| 26 | + |
| 27 | + - name: "Cache dependencies installed with composer" |
| 28 | + uses: "actions/cache@v1" |
| 29 | + with: |
| 30 | + path: "~/.composer/cache" |
| 31 | + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" |
| 32 | + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" |
| 33 | + |
| 34 | + - name: "Install dependencies with composer" |
| 35 | + run: "composer install --no-progress --no-suggest --no-interaction --prefer-dist" |
| 36 | + |
| 37 | + - name: "Run a static analysis with phpstan/phpstan" |
| 38 | + run: "php vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr" |
| 39 | + |
| 40 | + static-analysis-psalm: |
| 41 | + name: "Static Analysis with Psalm" |
| 42 | + runs-on: "ubuntu-latest" |
| 43 | + |
| 44 | + strategy: |
| 45 | + matrix: |
| 46 | + php-version: |
| 47 | + - "7.4" |
| 48 | + |
| 49 | + steps: |
| 50 | + - name: "Checkout code" |
| 51 | + uses: "actions/checkout@v2" |
| 52 | + |
| 53 | + - name: "Install PHP" |
| 54 | + uses: "shivammathur/setup-php@v2" |
| 55 | + with: |
| 56 | + coverage: "none" |
| 57 | + php-version: "${{ matrix.php-version }}" |
| 58 | + |
| 59 | + - name: "Cache dependencies installed with composer" |
| 60 | + uses: "actions/cache@v1" |
| 61 | + with: |
| 62 | + path: "~/.composer/cache" |
| 63 | + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" |
| 64 | + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" |
| 65 | + |
| 66 | + - name: "Install dependencies with composer" |
| 67 | + run: "composer install --no-interaction --no-progress --no-suggest" |
| 68 | + |
| 69 | + - name: "Run a static analysis with vimeo/psalm" |
| 70 | + run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc)" |
0 commit comments