|
| 1 | +on: push |
| 2 | +name: Qa workflow |
| 3 | +jobs: |
| 4 | + setup: |
| 5 | + runs-on: ubuntu-latest |
| 6 | + steps: |
| 7 | + - uses: actions/checkout@master |
| 8 | + - name: Restore/cache vendor folder |
| 9 | + uses: actions/cache@v1 |
| 10 | + with: |
| 11 | + path: vendor |
| 12 | + key: all-build-${{ hashFiles('**/composer.lock') }} |
| 13 | + restore-keys: | |
| 14 | + all-build-${{ hashFiles('**/composer.lock') }} |
| 15 | + all-build- |
| 16 | + - name: Restore/cache tools folder |
| 17 | + uses: actions/cache@v1 |
| 18 | + with: |
| 19 | + path: tools |
| 20 | + key: all-tools-${{ github.sha }} |
| 21 | + restore-keys: | |
| 22 | + all-tools-${{ github.sha }}- |
| 23 | + all-tools- |
| 24 | + - name: composer |
| 25 | + uses: docker://composer |
| 26 | + env: |
| 27 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 28 | + with: |
| 29 | + args: install --no-interaction --prefer-dist --optimize-autoloader |
| 30 | + - name: composer-require-checker |
| 31 | + uses: docker://phpga/composer-require-checker-ga |
| 32 | + env: |
| 33 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 34 | + with: |
| 35 | + args: check --config-file ./composer-require-config.json composer.json |
| 36 | + - name: Install phive |
| 37 | + run: make install-phive |
| 38 | + - name: Install PHAR dependencies |
| 39 | + run: tools/phive.phar --no-progress install --copy --trust-gpg-keys 4AA394086372C20A,D2CCAC42F6295E7D,E82B2FB314E9906E,8E730BA25823D8B5 --force-accept-unsigned |
| 40 | + |
| 41 | + phpunit-with-coverage: |
| 42 | + runs-on: ubuntu-latest |
| 43 | + name: Unit tests |
| 44 | + needs: setup |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@master |
| 47 | + - name: Restore/cache vendor folder |
| 48 | + uses: actions/cache@v1 |
| 49 | + with: |
| 50 | + path: vendor |
| 51 | + key: all-build-${{ hashFiles('**/composer.lock') }} |
| 52 | + restore-keys: | |
| 53 | + all-build-${{ hashFiles('**/composer.lock') }} |
| 54 | + all-build- |
| 55 | + - name: Restore/cache tools folder |
| 56 | + uses: actions/cache@v1 |
| 57 | + with: |
| 58 | + path: tools |
| 59 | + key: all-tools-${{ github.sha }} |
| 60 | + restore-keys: | |
| 61 | + all-tools-${{ github.sha }}- |
| 62 | + all-tools- |
| 63 | + - name: Setup PHP |
| 64 | + uses: shivammathur/setup-php@master |
| 65 | + with: |
| 66 | + php-version: 7.2 |
| 67 | + extension-csv: mbstring, intl, iconv, libxml, dom, json, simplexml, zlib |
| 68 | + ini-values-csv: memory_limit=2G, display_errors=On, error_reporting=-1 |
| 69 | + coverage: xdebug |
| 70 | + pecl: false |
| 71 | + - name: Run PHPUnit |
| 72 | + run: php tools/phpunit |
| 73 | + |
| 74 | + phpunit: |
| 75 | + runs-on: ${{ matrix.operating-system }} |
| 76 | + strategy: |
| 77 | + matrix: |
| 78 | + operating-system: |
| 79 | + - ubuntu-latest |
| 80 | + - windows-latest |
| 81 | + - macOS-latest |
| 82 | + php-versions: ['7.2', '7.3', '7.4'] |
| 83 | + name: Unit tests for PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }} |
| 84 | + needs: |
| 85 | + - setup |
| 86 | + - phpunit-with-coverage |
| 87 | + steps: |
| 88 | + - uses: actions/checkout@master |
| 89 | + - name: Restore/cache vendor folder |
| 90 | + uses: actions/cache@v1 |
| 91 | + with: |
| 92 | + path: vendor |
| 93 | + key: all-build-${{ hashFiles('**/composer.lock') }} |
| 94 | + restore-keys: | |
| 95 | + all-build-${{ hashFiles('**/composer.lock') }} |
| 96 | + all-build- |
| 97 | + - name: Restore/cache tools folder |
| 98 | + uses: actions/cache@v1 |
| 99 | + with: |
| 100 | + path: tools |
| 101 | + key: all-tools-${{ github.sha }} |
| 102 | + restore-keys: | |
| 103 | + all-tools-${{ github.sha }}- |
| 104 | + all-tools- |
| 105 | + - name: Setup PHP |
| 106 | + uses: shivammathur/setup-php@master |
| 107 | + with: |
| 108 | + php-version: ${{ matrix.php-versions }} |
| 109 | + extension-csv: mbstring, intl, iconv, libxml, dom, json, simplexml, zlib |
| 110 | + ini-values-csv: memory_limit=2G, display_errors=On, error_reporting=-1 |
| 111 | + pecl: false |
| 112 | + - name: Run PHPUnit |
| 113 | + continue-on-error: true |
| 114 | + run: php tools/phpunit |
| 115 | + |
| 116 | + codestyle: |
| 117 | + runs-on: ubuntu-latest |
| 118 | + needs: [setup, phpunit] |
| 119 | + steps: |
| 120 | + - uses: actions/checkout@master |
| 121 | + - name: Restore/cache vendor folder |
| 122 | + uses: actions/cache@v1 |
| 123 | + with: |
| 124 | + path: vendor |
| 125 | + key: all-build-${{ hashFiles('**/composer.lock') }} |
| 126 | + restore-keys: | |
| 127 | + all-build-${{ hashFiles('**/composer.lock') }} |
| 128 | + all-build- |
| 129 | + - name: Restore/cache tools folder |
| 130 | + uses: actions/cache@v1 |
| 131 | + with: |
| 132 | + path: tools |
| 133 | + key: all-tools-${{ github.sha }} |
| 134 | + restore-keys: | |
| 135 | + all-tools-${{ github.sha }}- |
| 136 | + all-tools- |
| 137 | + - name: Code style check |
| 138 | + uses: docker://phpdoc/phpcs-ga:latest |
| 139 | + env: |
| 140 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 141 | + with: |
| 142 | + args: -d memory_limit=1024M |
| 143 | + |
| 144 | + phpstan: |
| 145 | + runs-on: ubuntu-latest |
| 146 | + needs: [setup, phpunit] |
| 147 | + steps: |
| 148 | + - uses: actions/checkout@master |
| 149 | + - name: Restore/cache vendor folder |
| 150 | + uses: actions/cache@v1 |
| 151 | + with: |
| 152 | + path: vendor |
| 153 | + key: all-build-${{ hashFiles('**/composer.lock') }} |
| 154 | + restore-keys: | |
| 155 | + all-build-${{ hashFiles('**/composer.lock') }} |
| 156 | + all-build- |
| 157 | + - name: Restore/cache tools folder |
| 158 | + uses: actions/cache@v1 |
| 159 | + with: |
| 160 | + path: tools |
| 161 | + key: all-tools-${{ github.sha }} |
| 162 | + restore-keys: | |
| 163 | + all-tools-${{ github.sha }}- |
| 164 | + all-tools- |
| 165 | + - name: PHPStan |
| 166 | + uses: docker://phpdoc/phpstan-ga:latest |
| 167 | + env: |
| 168 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 169 | + with: |
| 170 | + args: analyse src --level max --configuration phpstan.neon |
| 171 | + |
| 172 | + psalm: |
| 173 | + runs-on: ubuntu-latest |
| 174 | + needs: [setup, phpunit] |
| 175 | + steps: |
| 176 | + - uses: actions/checkout@master |
| 177 | + - name: Restore/cache vendor folder |
| 178 | + uses: actions/cache@v1 |
| 179 | + with: |
| 180 | + path: vendor |
| 181 | + key: all-build-${{ hashFiles('**/composer.lock') }} |
| 182 | + restore-keys: | |
| 183 | + all-build-${{ hashFiles('**/composer.lock') }} |
| 184 | + all-build- |
| 185 | + - name: Restore/cache tools folder |
| 186 | + uses: actions/cache@v1 |
| 187 | + with: |
| 188 | + path: tools |
| 189 | + key: all-tools-${{ github.sha }} |
| 190 | + restore-keys: | |
| 191 | + all-tools-${{ github.sha }}- |
| 192 | + all-tools- |
| 193 | + - name: Psalm |
| 194 | + uses: docker://mickaelandrieu/psalm-ga |
| 195 | + env: |
| 196 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments