|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + tags: |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + runs-on: ubuntu-18.04 |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + php: [7.1, 7.2, 7.3, 7.4] |
| 15 | + env: [ |
| 16 | + 'EXECUTOR= DEPENDENCIES=--prefer-lowest', |
| 17 | + 'EXECUTOR=coroutine DEPENDENCIES=--prefer-lowest', |
| 18 | + 'EXECUTOR=', |
| 19 | + 'EXECUTOR=coroutine', |
| 20 | + ] |
| 21 | + name: PHP ${{ matrix.php }} Test ${{ matrix.env }} |
| 22 | + |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v1 |
| 25 | + |
| 26 | + - name: Install PHP |
| 27 | + uses: shivammathur/[email protected] |
| 28 | + with: |
| 29 | + php-version: ${{ matrix.php }} |
| 30 | + extension-csv: json, mbstring |
| 31 | + - name: Get Composer Cache Directory |
| 32 | + id: composer-cache |
| 33 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 34 | + |
| 35 | + - name: Cache dependencies |
| 36 | + uses: actions/cache@v1 |
| 37 | + with: |
| 38 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 39 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 40 | + restore-keys: ${{ runner.os }}-composer- |
| 41 | + |
| 42 | + - name: Install Dependencies |
| 43 | + run: composer install ${DEPENDENCIES} |
| 44 | + |
| 45 | + - name: Run unit tests |
| 46 | + run: | |
| 47 | + export $ENV |
| 48 | + ./vendor/bin/phpunit --group default,ReactPromise |
| 49 | + env: |
| 50 | + ENV: ${{ matrix.env}} |
| 51 | + |
| 52 | + coding-standard: |
| 53 | + runs-on: ubuntu-18.04 |
| 54 | + name: Coding Standard |
| 55 | + |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v1 |
| 58 | + |
| 59 | + - name: Install PHP |
| 60 | + uses: shivammathur/[email protected] |
| 61 | + with: |
| 62 | + php-version: 7.1 |
| 63 | + extension-csv: json, mbstring |
| 64 | + |
| 65 | + - name: Get Composer Cache Directory |
| 66 | + id: composer-cache |
| 67 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 68 | + |
| 69 | + - name: Cache dependencies |
| 70 | + uses: actions/cache@v1 |
| 71 | + with: |
| 72 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 73 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 74 | + restore-keys: ${{ runner.os }}-composer- |
| 75 | + |
| 76 | + - name: Install Dependencies |
| 77 | + run: composer install ${DEPENDENCIES} |
| 78 | + |
| 79 | + - name: Coding Standard |
| 80 | + run: composer lint |
| 81 | + |
| 82 | + phpstan: |
| 83 | + runs-on: ubuntu-18.04 |
| 84 | + name: PHPStan |
| 85 | + |
| 86 | + steps: |
| 87 | + - uses: actions/checkout@v1 |
| 88 | + |
| 89 | + - name: Install PHP |
| 90 | + uses: shivammathur/[email protected] |
| 91 | + with: |
| 92 | + php-version: 7.1 |
| 93 | + extension-csv: json, mbstring |
| 94 | + |
| 95 | + - name: Get Composer Cache Directory |
| 96 | + id: composer-cache |
| 97 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 98 | + |
| 99 | + - name: Cache dependencies |
| 100 | + uses: actions/cache@v1 |
| 101 | + with: |
| 102 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 103 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 104 | + restore-keys: ${{ runner.os }}-composer- |
| 105 | + |
| 106 | + - name: Install Dependencies |
| 107 | + run: composer install ${DEPENDENCIES} |
| 108 | + |
| 109 | + - name: PHPStan |
| 110 | + run: composer stan |
| 111 | + |
| 112 | + coverage: |
| 113 | + runs-on: ubuntu-18.04 |
| 114 | + name: Code Coverage |
| 115 | + |
| 116 | + steps: |
| 117 | + - uses: actions/checkout@v1 |
| 118 | + |
| 119 | + - name: Install PHP |
| 120 | + uses: shivammathur/[email protected] |
| 121 | + with: |
| 122 | + php-version: 7.1 |
| 123 | + extension-csv: json, mbstring |
| 124 | + coverage: pcov |
| 125 | + pecl: true |
| 126 | + |
| 127 | + - name: Get Composer Cache Directory |
| 128 | + id: composer-cache |
| 129 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 130 | + |
| 131 | + - name: Cache dependencies |
| 132 | + uses: actions/cache@v1 |
| 133 | + with: |
| 134 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 135 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 136 | + restore-keys: ${{ runner.os }}-composer- |
| 137 | + |
| 138 | + - name: Install Dependencies |
| 139 | + run: composer install ${DEPENDENCIES} |
| 140 | + |
| 141 | + - name: Update xdebug version |
| 142 | + run: | |
| 143 | + sudo pecl channel-update pecl.php.net |
| 144 | + sudo pecl install xdebug-2.9.0 |
| 145 | + continue-on-error: true |
| 146 | + |
| 147 | + - name: Code coverage |
| 148 | + run: | |
| 149 | + ./vendor/bin/phpunit --coverage-php /tmp/coverage/clover_executor.cov |
| 150 | + EXECUTOR=coroutine ./vendor/bin/phpunit --coverage-php /tmp/coverage/clover_executor-coroutine.cov |
| 151 | + ./vendor/bin/phpcov merge /tmp/coverage --clover /tmp/clover.xml |
| 152 | + wget https://github.com/scrutinizer-ci/ocular/releases/download/1.5.2/ocular.phar |
| 153 | + php7.1 ocular.phar code-coverage:upload --format=php-clover /tmp/clover.xml |
0 commit comments