|
| 1 | +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions |
| 2 | + |
| 3 | +name: "Build" |
| 4 | + |
| 5 | +on: |
| 6 | + pull_request: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - "master" |
| 10 | + |
| 11 | +jobs: |
| 12 | + lint: |
| 13 | + name: "Lint" |
| 14 | + runs-on: "ubuntu-latest" |
| 15 | + |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + php-version: |
| 19 | + - "7.1" |
| 20 | + - "7.2" |
| 21 | + - "7.3" |
| 22 | + - "7.4" |
| 23 | + - "8.0" |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: "Checkout" |
| 27 | + uses: "actions/checkout@v2" |
| 28 | + |
| 29 | + - name: "Install PHP" |
| 30 | + uses: "shivammathur/setup-php@v2" |
| 31 | + with: |
| 32 | + coverage: "none" |
| 33 | + php-version: "${{ matrix.php-version }}" |
| 34 | + |
| 35 | + - name: "Validate Composer" |
| 36 | + run: "composer validate" |
| 37 | + |
| 38 | + - name: "Install dependencies" |
| 39 | + run: "composer install --no-interaction --no-progress --no-suggest" |
| 40 | + |
| 41 | + - name: "Lint" |
| 42 | + run: "vendor/bin/phing lint" |
| 43 | + |
| 44 | + coding-standards: |
| 45 | + name: "Coding Standard" |
| 46 | + |
| 47 | + runs-on: "ubuntu-latest" |
| 48 | + |
| 49 | + steps: |
| 50 | + - name: "Checkout" |
| 51 | + uses: "actions/checkout@v2" |
| 52 | + |
| 53 | + - name: "Install PHP" |
| 54 | + uses: "shivammathur/setup-php@v2" |
| 55 | + with: |
| 56 | + coverage: "none" |
| 57 | + php-version: "7.4" |
| 58 | + |
| 59 | + - name: "Validate Composer" |
| 60 | + run: "composer validate" |
| 61 | + |
| 62 | + - name: "Install dependencies" |
| 63 | + run: "composer install --no-interaction --no-progress --no-suggest" |
| 64 | + |
| 65 | + - name: "Lint" |
| 66 | + run: "vendor/bin/phing lint" |
| 67 | + |
| 68 | + - name: "Coding Standard" |
| 69 | + run: "vendor/bin/phing cs" |
| 70 | + |
| 71 | + static-analysis: |
| 72 | + name: "PHPStan" |
| 73 | + runs-on: "ubuntu-latest" |
| 74 | + |
| 75 | + strategy: |
| 76 | + fail-fast: false |
| 77 | + matrix: |
| 78 | + php-version: |
| 79 | + - "7.1" |
| 80 | + - "7.2" |
| 81 | + - "7.3" |
| 82 | + - "7.4" |
| 83 | + - "8.0" |
| 84 | + dependencies: |
| 85 | + - "lowest" |
| 86 | + - "highest" |
| 87 | + |
| 88 | + steps: |
| 89 | + - name: "Checkout" |
| 90 | + uses: "actions/checkout@v2" |
| 91 | + |
| 92 | + - name: "Install PHP" |
| 93 | + uses: "shivammathur/setup-php@v2" |
| 94 | + with: |
| 95 | + coverage: "none" |
| 96 | + php-version: "${{ matrix.php-version }}" |
| 97 | + extensions: mbstring |
| 98 | + tools: composer:v2 |
| 99 | + |
| 100 | + - name: "Install lowest dependencies" |
| 101 | + if: ${{ matrix.dependencies == 'lowest' }} |
| 102 | + run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" |
| 103 | + |
| 104 | + - name: "Install highest dependencies" |
| 105 | + if: ${{ matrix.dependencies == 'highest' }} |
| 106 | + run: "composer update --no-interaction --no-progress --no-suggest" |
| 107 | + |
| 108 | + - name: "Update PHPStan" |
| 109 | + if: matrix.php-version == '8.0' |
| 110 | + run: "composer require --dev phpstan/phpstan:'^0.12.60' --update-with-dependencies" |
| 111 | + |
| 112 | + - name: "PHPStan" |
| 113 | + run: "vendor/bin/phing phpstan" |
0 commit comments