|
12 | 12 | EXT_PCOV_VERSION: '1.0.6'
|
13 | 13 |
|
14 | 14 | jobs:
|
| 15 | + php-cs-fixer: |
| 16 | + name: PHP-CS-Fixer (PHP ${{ matrix.php }}) |
| 17 | + runs-on: ubuntu-latest |
| 18 | + container: |
| 19 | + image: php:${{ matrix.php }}-alpine |
| 20 | + options: >- |
| 21 | + --tmpfs /tmp:exec |
| 22 | + --tmpfs /var/tmp:exec |
| 23 | + strategy: |
| 24 | + matrix: |
| 25 | + php: |
| 26 | + - '7.4' |
| 27 | + fail-fast: false |
| 28 | + timeout-minutes: 5 |
| 29 | + env: |
| 30 | + PHP_CS_FIXER_FUTURE_MODE: '1' |
| 31 | + PHP_CS_FIXER_VERSION: '^2.14' |
| 32 | + steps: |
| 33 | + - name: Checkout |
| 34 | + uses: actions/checkout@v1 |
| 35 | + - name: Install system packages |
| 36 | + run: | |
| 37 | + apk add \ |
| 38 | + unzip \ |
| 39 | + - name: Disable PHP memory limit |
| 40 | + run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini |
| 41 | + - name: Install Composer |
| 42 | + run: wget -qO - https://raw.githubusercontent.com/composer/getcomposer.org/$COMPOSER_INSTALLER_COMMIT/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet |
| 43 | + - name: Cache Composer packages |
| 44 | + uses: actions/cache@v1 |
| 45 | + with: |
| 46 | + path: ~/.composer/cache |
| 47 | + key: composer-php${{ matrix.php }}-php-cs-fixer-${{ github.sha }} |
| 48 | + restore-keys: | |
| 49 | + composer-php${{ matrix.php }}-php-cs-fixer- |
| 50 | + composer-php${{ matrix.php }}- |
| 51 | + composer- |
| 52 | + continue-on-error: true |
| 53 | + - name: Install Symfony Flex |
| 54 | + run: | |
| 55 | + composer global require --prefer-dist --no-progress --no-suggest --ansi \ |
| 56 | + symfony/flex |
| 57 | + - name: Install PHP-CS-Fixer |
| 58 | + run: | |
| 59 | + composer global require --prefer-dist --no-progress --no-suggest --ansi \ |
| 60 | + friendsofphp/php-cs-fixer:"${PHP_CS_FIXER_VERSION}" |
| 61 | + - name: Cache PHP-CS-Fixer results |
| 62 | + uses: actions/cache@v1 |
| 63 | + with: |
| 64 | + path: /var/cache/php-cs-fixer |
| 65 | + key: php-cs-fixer-php${{ matrix.php }}-${{ github.sha }} |
| 66 | + restore-keys: | |
| 67 | + php-cs-fixer-php${{ matrix.php }}- |
| 68 | + php-cs-fixer- |
| 69 | + continue-on-error: true |
| 70 | + - name: Run PHP-CS-Fixer fix |
| 71 | + run: | |
| 72 | + export PATH="$PATH:$HOME/.composer/vendor/bin" |
| 73 | + mkdir -p /var/cache/php-cs-fixer |
| 74 | + php-cs-fixer fix --dry-run --diff --cache-file=/var/cache/php-cs-fixer/.php_cs.cache --ansi |
| 75 | +
|
| 76 | + phpstan: |
| 77 | + name: PHPStan (PHP ${{ matrix.php }}) |
| 78 | + runs-on: ubuntu-latest |
| 79 | + container: |
| 80 | + image: php:${{ matrix.php }}-alpine |
| 81 | + options: >- |
| 82 | + --tmpfs /tmp:exec |
| 83 | + --tmpfs /var/tmp:exec |
| 84 | + strategy: |
| 85 | + matrix: |
| 86 | + php: |
| 87 | + - '7.4' |
| 88 | + fail-fast: false |
| 89 | + timeout-minutes: 5 |
| 90 | + env: |
| 91 | + APP_DEBUG: '1' # https://github.com/phpstan/phpstan-symfony/issues/37 |
| 92 | + steps: |
| 93 | + - name: Checkout |
| 94 | + uses: actions/checkout@v1 |
| 95 | + - name: Install system packages |
| 96 | + run: | |
| 97 | + apk add \ |
| 98 | + unzip \ |
| 99 | + - name: Disable PHP memory limit |
| 100 | + run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini |
| 101 | + - name: Install Composer |
| 102 | + run: wget -qO - https://raw.githubusercontent.com/composer/getcomposer.org/$COMPOSER_INSTALLER_COMMIT/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet |
| 103 | + - name: Cache Composer packages |
| 104 | + uses: actions/cache@v1 |
| 105 | + with: |
| 106 | + path: ~/.composer/cache |
| 107 | + key: composer-php${{ matrix.php }}-${{ github.sha }} |
| 108 | + restore-keys: | |
| 109 | + composer-php${{ matrix.php }}- |
| 110 | + composer- |
| 111 | + continue-on-error: true |
| 112 | + - name: Install Symfony Flex |
| 113 | + run: | |
| 114 | + composer global require --prefer-dist --no-progress --no-suggest --ansi \ |
| 115 | + symfony/flex |
| 116 | + - name: Update project dependencies |
| 117 | + run: | |
| 118 | + mkdir -p /tmp/api-platform/core/vendor |
| 119 | + ln -s /tmp/api-platform/core/vendor vendor |
| 120 | + composer update --no-progress --no-suggest --ansi |
| 121 | + - name: Clear test app cache |
| 122 | + run: | |
| 123 | + mkdir -p /tmp/api-platform/core/var |
| 124 | + ln -s /tmp/api-platform/core/var tests/Fixtures/app/var |
| 125 | + tests/Fixtures/app/console cache:clear --ansi |
| 126 | + - name: Cache PHPStan results |
| 127 | + uses: actions/cache@v1 |
| 128 | + with: |
| 129 | + path: /tmp/phpstan |
| 130 | + key: phpstan-php${{ matrix.php }}-${{ github.sha }} |
| 131 | + restore-keys: | |
| 132 | + phpstan-php${{ matrix.php }}- |
| 133 | + phpstan- |
| 134 | + continue-on-error: true |
| 135 | + - name: Run PHPStan analysis |
| 136 | + run: vendor/bin/phpstan analyse --ansi |
| 137 | + |
15 | 138 | phpunit:
|
16 | 139 | name: PHPUnit (PHP ${{ matrix.php }})
|
17 | 140 | runs-on: ubuntu-latest
|
|
0 commit comments