|
| 1 | +# Copyright © Magento, Inc. All rights reserved. |
| 2 | +# See COPYING.txt for license details. |
| 3 | + |
| 4 | +name: CI |
| 5 | + |
| 6 | +on: [pull_request] |
| 7 | + |
| 8 | +jobs: |
| 9 | + unit-tests: |
| 10 | + name: Unit Tests |
| 11 | + runs-on: ubuntu-latest |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + php-versions: ['7.1', '7.2', '7.3'] |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v2 |
| 18 | + |
| 19 | + - name: Setup PHP |
| 20 | + uses: shivammathur/setup-php@master |
| 21 | + with: |
| 22 | + php-version: ${{ matrix.php-versions }} |
| 23 | + extensions: curl, dom, intl, json, openssl |
| 24 | + |
| 25 | + - name: Cache Composer packages |
| 26 | + id: composer-cache |
| 27 | + uses: actions/cache@v2 |
| 28 | + with: |
| 29 | + path: vendor |
| 30 | + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} |
| 31 | + restore-keys: | |
| 32 | + ${{ runner.os }}-php- |
| 33 | + |
| 34 | + - name: Install dependencies |
| 35 | + if: steps.composer-cache.outputs.cache-hit != 'true' |
| 36 | + run: composer install --prefer-dist --no-progress --no-suggest |
| 37 | + |
| 38 | + - name: Run tests |
| 39 | + run: vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite unit --coverage-clover clover.xml |
| 40 | + |
| 41 | + - name: Monitor coverage |
| 42 | + if: github.event_name == 'pull_request' |
| 43 | + uses: slavcodev/coverage-monitor-action@1.1.0 |
| 44 | + with: |
| 45 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 46 | + clover_file: "clover.xml" |
| 47 | + threshold_alert: 10 |
| 48 | + threshold_warning: 20 |
| 49 | + |
| 50 | + verification-tests: |
| 51 | + name: Verification Tests |
| 52 | + runs-on: ubuntu-latest |
| 53 | + strategy: |
| 54 | + fail-fast: false |
| 55 | + matrix: |
| 56 | + php-versions: ['7.1', '7.2', '7.3'] |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v2 |
| 59 | + |
| 60 | + - name: Setup PHP |
| 61 | + uses: shivammathur/setup-php@master |
| 62 | + with: |
| 63 | + php-version: ${{ matrix.php-versions }} |
| 64 | + extensions: curl, dom, intl, json, openssl |
| 65 | + |
| 66 | + - name: Cache Composer packages |
| 67 | + id: composer-cache |
| 68 | + uses: actions/cache@v2 |
| 69 | + with: |
| 70 | + path: vendor |
| 71 | + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} |
| 72 | + restore-keys: | |
| 73 | + ${{ runner.os }}-php- |
| 74 | + |
| 75 | + - name: Install dependencies |
| 76 | + if: steps.composer-cache.outputs.cache-hit != 'true' |
| 77 | + run: composer install --prefer-dist --no-progress --no-suggest |
| 78 | + |
| 79 | + - name: Run tests |
| 80 | + run: vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite verification |
| 81 | + |
| 82 | + static-tests: |
| 83 | + name: Static Tests |
| 84 | + runs-on: ubuntu-latest |
| 85 | + strategy: |
| 86 | + fail-fast: false |
| 87 | + matrix: |
| 88 | + php-versions: ['7.1', '7.2', '7.3'] |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@v2 |
| 91 | + |
| 92 | + - name: Setup PHP |
| 93 | + uses: shivammathur/setup-php@master |
| 94 | + with: |
| 95 | + php-version: ${{ matrix.php-versions }} |
| 96 | + extensions: curl, dom, intl, json, openssl |
| 97 | + coverage: none |
| 98 | + if: ${{ matrix.php-versions >= 7.2 }} |
| 99 | + |
| 100 | + - name: Cache Composer packages |
| 101 | + id: composer-cache |
| 102 | + uses: actions/cache@v2 |
| 103 | + with: |
| 104 | + path: vendor |
| 105 | + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} |
| 106 | + restore-keys: | |
| 107 | + ${{ runner.os }}-php- |
| 108 | + |
| 109 | + - name: Install dependencies |
| 110 | + if: steps.composer-cache.outputs.cache-hit != 'true' |
| 111 | + run: composer install --prefer-dist --no-progress --no-suggest |
| 112 | + |
| 113 | + - name: Run tests |
| 114 | + run: bin/static-checks |
| 115 | + |
| 116 | + functional-tests: |
| 117 | + name: Functional Tests |
| 118 | + runs-on: ubuntu-latest |
| 119 | + strategy: |
| 120 | + fail-fast: false |
| 121 | + matrix: |
| 122 | + php-versions: ['7.1', '7.2', '7.3'] |
| 123 | + |
| 124 | + services: |
| 125 | + chrome: |
| 126 | + image: selenium/standalone-chrome:3.141.59-zirconium |
| 127 | + ports: |
| 128 | + - 4444:4444 |
| 129 | + steps: |
| 130 | + - uses: actions/checkout@v2 |
| 131 | + |
| 132 | + - name: Setup PHP |
| 133 | + uses: shivammathur/setup-php@master |
| 134 | + with: |
| 135 | + php-version: ${{ matrix.php-versions }} |
| 136 | + extensions: curl, dom, intl, json, openssl |
| 137 | + |
| 138 | + - name: Cache Composer packages |
| 139 | + id: composer-cache |
| 140 | + uses: actions/cache@v2 |
| 141 | + with: |
| 142 | + path: vendor |
| 143 | + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} |
| 144 | + restore-keys: | |
| 145 | + ${{ runner.os }}-php- |
| 146 | +
|
| 147 | + - name: Install dependencies |
| 148 | + if: steps.composer-cache.outputs.cache-hit != 'true' |
| 149 | + run: composer install --prefer-dist --no-progress --no-suggest |
| 150 | + |
| 151 | + - name: Run tests |
| 152 | + run: bin/functional |
0 commit comments