|
| 1 | +# GitHub Actions Documentation: https://docs.github.com/en/actions |
| 2 | + |
| 3 | +name: "build" |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - "main" |
| 9 | + tags: |
| 10 | + - "*" |
| 11 | + pull_request: |
| 12 | + branches: |
| 13 | + - "main" |
| 14 | + |
| 15 | +# Cancels all previous workflow runs for the same branch that have not yet completed. |
| 16 | +concurrency: |
| 17 | + # The concurrency group contains the workflow name and the branch name. |
| 18 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 19 | + cancel-in-progress: true |
| 20 | + |
| 21 | +env: |
| 22 | + COMPOSER_ROOT_VERSION: "1.99.99" |
| 23 | + |
| 24 | +jobs: |
| 25 | + coding-standards: |
| 26 | + name: "Coding standards" |
| 27 | + runs-on: "ubuntu-latest" |
| 28 | + steps: |
| 29 | + - name: "Checkout repository" |
| 30 | + uses: "actions/checkout@v2" |
| 31 | + |
| 32 | + - name: "Install PHP" |
| 33 | + uses: "shivammathur/setup-php@v2" |
| 34 | + with: |
| 35 | + php-version: "7.4" |
| 36 | + coverage: none |
| 37 | + |
| 38 | + - name: "Install dependencies (Composer)" |
| 39 | + uses: "ramsey/composer-install@v2" |
| 40 | + |
| 41 | + - name: "Check coding standards (PHP CS Fixer)" |
| 42 | + shell: "bash" |
| 43 | + run: "composer style-lint" |
| 44 | + |
| 45 | + static-analysis: |
| 46 | + name: "Static analysis" |
| 47 | + runs-on: "ubuntu-latest" |
| 48 | + steps: |
| 49 | + - name: "Checkout repository" |
| 50 | + uses: "actions/checkout@v2" |
| 51 | + |
| 52 | + - name: "Install PHP" |
| 53 | + uses: "shivammathur/setup-php@v2" |
| 54 | + with: |
| 55 | + php-version: "7.4" |
| 56 | + coverage: "none" |
| 57 | + |
| 58 | + - name: "Install dependencies (Composer)" |
| 59 | + uses: "ramsey/composer-install@v2" |
| 60 | + |
| 61 | + - name: "Statically analyze code (PHPStan)" |
| 62 | + shell: "bash" |
| 63 | + run: "composer stan" |
| 64 | + |
| 65 | + unit-tests: |
| 66 | + name: "Unit tests" |
| 67 | + runs-on: "ubuntu-latest" |
| 68 | + steps: |
| 69 | + - name: "Checkout repository" |
| 70 | + uses: "actions/checkout@v2" |
| 71 | + |
| 72 | + - name: "Install PHP" |
| 73 | + uses: "shivammathur/setup-php@v2" |
| 74 | + with: |
| 75 | + php-version: 7.4" |
| 76 | + ini-values: "memory_limit=-1" |
| 77 | + |
| 78 | + - name: "Install dependencies (Composer)" |
| 79 | + uses: "ramsey/composer-install@v2" |
| 80 | + |
| 81 | + - name: "Run unit tests (PHPUnit)" |
| 82 | + shell: "bash" |
| 83 | + run: "composer test" |
0 commit comments