|
| 1 | +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions |
| 2 | + |
| 3 | +on: |
| 4 | + - pull_request |
| 5 | + - push |
| 6 | + |
| 7 | +name: "Continuous Integration" |
| 8 | + |
| 9 | +jobs: |
| 10 | + coding-standards: |
| 11 | + name: "Coding Standards" |
| 12 | + |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: "Checkout" |
| 17 | + uses: actions/checkout@master |
| 18 | + |
| 19 | + - name: "Validate composer.json and composer.lock" |
| 20 | + run: php7.3 /usr/bin/composer validate --strict |
| 21 | + |
| 22 | + - name: "Install locked dependencies with composer" |
| 23 | + run: php7.3 /usr/bin/composer install --no-interaction --no-progress --no-suggest |
| 24 | + |
| 25 | + - name: "Run localheinz/composer-normalize" |
| 26 | + run: php7.3 /usr/bin/composer normalize --dry-run |
| 27 | + |
| 28 | + static-code-analysis: |
| 29 | + name: "Static Code Analysis" |
| 30 | + |
| 31 | + runs-on: ubuntu-latest |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: "Checkout" |
| 35 | + uses: actions/checkout@master |
| 36 | + |
| 37 | + - name: "Install locked dependencies with composer" |
| 38 | + run: php7.3 /usr/bin/composer install --no-interaction --no-progress --no-suggest |
| 39 | + |
| 40 | + - name: "Run phpstan/phpstan" |
| 41 | + run: php7.3 vendor/bin/phpstan analyse --configuration=phpstan.neon |
| 42 | + |
| 43 | + tests: |
| 44 | + name: "Tests" |
| 45 | + |
| 46 | + runs-on: ubuntu-latest |
| 47 | + |
| 48 | + strategy: |
| 49 | + matrix: |
| 50 | + php-binary: |
| 51 | + - php7.2 |
| 52 | + - php7.3 |
| 53 | + |
| 54 | + dependencies: |
| 55 | + - lowest |
| 56 | + - locked |
| 57 | + - highest |
| 58 | + |
| 59 | + steps: |
| 60 | + - name: "Checkout" |
| 61 | + uses: actions/checkout@master |
| 62 | + |
| 63 | + - name: "Install lowest dependencies with composer" |
| 64 | + if: matrix.dependencies == 'lowest' |
| 65 | + run: ${{ matrix.php-binary }} /usr/bin/composer update --prefer-lowest --no-interaction --no-progress --no-suggest |
| 66 | + |
| 67 | + - name: "Install locked dependencies with composer" |
| 68 | + if: matrix.dependencies == 'locked' |
| 69 | + run: ${{ matrix.php-binary }} /usr/bin/composer install --no-interaction --no-progress --no-suggest |
| 70 | + |
| 71 | + - name: "Install highest dependencies with composer" |
| 72 | + if: matrix.dependencies == 'highest' |
| 73 | + run: ${{ matrix.php-binary }} /usr/bin/composer update --no-interaction --no-progress --no-suggest |
| 74 | + |
| 75 | + - name: "Run unit tests with phpunit/phpunit" |
| 76 | + run: ${{ matrix.php-binary }} vendor/bin/phpunit |
| 77 | + |
| 78 | + code-coverage: |
| 79 | + name: "Code Coverage" |
| 80 | + |
| 81 | + runs-on: ubuntu-latest |
| 82 | + |
| 83 | + steps: |
| 84 | + - name: "Checkout" |
| 85 | + uses: actions/checkout@master |
| 86 | + |
| 87 | + - name: "Install locked dependencies with composer" |
| 88 | + run: php7.3 /usr/bin/composer install --no-interaction --no-progress --no-suggest |
| 89 | + |
| 90 | + - name: "Dump Xdebug filter with phpunit/phpunit" |
| 91 | + run: php7.3 vendor/bin/phpunit --dump-xdebug-filter=.build/phpunit/xdebug-filter.php |
| 92 | + |
| 93 | + - name: "Collect code coverage with Xdebug and phpunit/phpunit" |
| 94 | + run: php7.3 vendor/bin/phpunit --coverage-clover=build/logs/clover.xml --prepend=.build/phpunit/xdebug-filter.php |
| 95 | + |
| 96 | + # Not using codecov/codecov-action for now, as the build is prohibitively slow |
| 97 | + - name: "Download code coverage uploader for Codecov.io" |
| 98 | + run: curl -s https://codecov.io/bash -o codecov |
| 99 | + |
| 100 | + - name: "Send code coverage report to Codecov.io" |
| 101 | + run: bash codecov -t ${{ secrets.CODECOV_TOKEN }} |
| 102 | + |
| 103 | + mutation-tests: |
| 104 | + name: "Mutation Tests" |
| 105 | + |
| 106 | + runs-on: ubuntu-latest |
| 107 | + |
| 108 | + steps: |
| 109 | + - name: "Checkout" |
| 110 | + uses: actions/checkout@master |
| 111 | + |
| 112 | + - name: "Install locked dependencies with composer" |
| 113 | + run: php7.3 /usr/bin/composer install --no-interaction --no-progress --no-suggest |
| 114 | + |
| 115 | + - name: "Run mutation tests with infection/infection" |
| 116 | + run: php7.3 vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=100 --min-msi=100 |
0 commit comments