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