|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + testsuite: |
| 7 | + runs-on: ubuntu-18.04 |
| 8 | + strategy: |
| 9 | + fail-fast: false |
| 10 | + matrix: |
| 11 | + php-version: ['7.4', '8.0'] |
| 12 | + composer-opts: [''] |
| 13 | + include: |
| 14 | + - php-version: '7.2' |
| 15 | + composer-opts: '--prefer-lowest' |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v1 |
| 19 | + with: |
| 20 | + fetch-depth: 1 |
| 21 | + |
| 22 | + - name: Setup PHP |
| 23 | + uses: shivammathur/setup-php@v2 |
| 24 | + with: |
| 25 | + php-version: ${{ matrix.php-version }} |
| 26 | + extension-csv: mbstring, intl |
| 27 | + coverage: pcov |
| 28 | + |
| 29 | + - name: Composer install |
| 30 | + run: | |
| 31 | + composer update ${{ matrix.composer-opts }} |
| 32 | +
|
| 33 | + - name: Run PHPUnit |
| 34 | + run: | |
| 35 | + if [[ ${{ matrix.php-version }} == '7.4' ]]; then |
| 36 | + vendor/bin/phpunit --coverage-clover=coverage.xml |
| 37 | + else |
| 38 | + vendor/bin/phpunit |
| 39 | + fi |
| 40 | +
|
| 41 | + - name: Code Coverage Report |
| 42 | + if: matrix.php-version == '7.4' |
| 43 | + uses: codecov/codecov-action@v1 |
| 44 | + |
| 45 | + cs-stan: |
| 46 | + name: Coding Standard & Static Analysis |
| 47 | + runs-on: ubuntu-18.04 |
| 48 | + |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v1 |
| 51 | + with: |
| 52 | + fetch-depth: 1 |
| 53 | + |
| 54 | + - name: Setup PHP |
| 55 | + uses: shivammathur/setup-php@v2 |
| 56 | + with: |
| 57 | + php-version: '7.4' |
| 58 | + extension-csv: mbstring, intl |
| 59 | + coverage: none |
| 60 | + tools: cs2pr, psalm, phpstan |
| 61 | + |
| 62 | + - name: Composer Install |
| 63 | + run: composer require cakephp/cakephp-codesniffer:^4.1 |
| 64 | + |
| 65 | + - name: Run phpcs |
| 66 | + run: vendor/bin/phpcs --report=checkstyle -q --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/ | cs2pr |
| 67 | + |
| 68 | + - name: Run psalm |
| 69 | + if: success() || failure() |
| 70 | + run: psalm --output-format=github |
| 71 | + |
| 72 | + - name: Run phpstan |
| 73 | + if: success() || failure() |
| 74 | + run: phpstan analyse |
0 commit comments