Update phpcsstandards/phpcsextra #409
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
'on': | |
- push | |
env: | |
DEFAULT_PHP_VERSION: '8.1' | |
jobs: | |
phpSyntaxCheck: | |
name: 'Syntax Check (PHP ${{ matrix.php.version }})' | |
strategy: | |
matrix: | |
php: | |
- | |
version: '8.1' | |
experimental: false | |
- | |
version: '8.2' | |
experimental: false | |
- | |
version: '8.3' | |
experimental: true | |
- | |
version: '8.4' | |
experimental: true | |
runs-on: ubuntu-22.04 | |
steps: | |
- | |
uses: actions/checkout@v4 | |
- | |
name: 'Set up PHP ${{ matrix.php.version }}' | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '${{ matrix.php.version }}' | |
- | |
name: 'Syntax Check' | |
continue-on-error: '${{ matrix.php.experimental }}' | |
env: | |
LANG: C | |
run: | | |
find . \( -type d \( -name '.git' -or -name 'vendor' -or -name 'node_modules' -or -name 'runtime' \) -prune \) -or \( -type f -name '*.php' -print \) \ | |
| sort \ | |
| xargs -n 1 php -l | |
makeComposerCache: | |
name: 'Make composer cache' | |
runs-on: ubuntu-22.04 | |
steps: | |
- | |
uses: actions/checkout@v4 | |
- | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/composer/files | |
vendor | |
key: "${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}" | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- | |
name: 'Use PHP ${{ env.DEFAULT_PHP_VERSION }}' | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '${{ env.DEFAULT_PHP_VERSION }}' | |
- | |
name: 'Install Composer dependencies' | |
run: 'composer install --prefer-dist' | |
phpStyleCheck: | |
name: 'PHP Coding Style' | |
runs-on: ubuntu-22.04 | |
needs: | |
- makeComposerCache | |
steps: | |
- | |
uses: actions/checkout@v4 | |
- | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/composer/files | |
vendor | |
key: "${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}" | |
- | |
name: 'Use PHP ${{ env.DEFAULT_PHP_VERSION }}' | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '${{ env.DEFAULT_PHP_VERSION }}' | |
- | |
name: 'Install Composer dependencies' | |
run: 'composer install --prefer-dist' | |
- | |
name: 'Create config-files' | |
run: 'make -j config-files' | |
- | |
name: 'Run PHPCS' | |
run: ./vendor/bin/phpcs | |
- | |
name: 'Run PHPStan' | |
run: './vendor/bin/phpstan analyze --memory-limit=1G' | |
jsStyleCheck: | |
name: 'JS Coding Style' | |
runs-on: ubuntu-22.04 | |
steps: | |
- | |
uses: actions/checkout@v4 | |
- | |
name: 'Install NPM packages' | |
run: | | |
npm ci | |
- | |
name: 'Run semistandard' | |
run: | | |
npx semistandard --global=jQuery --global=bootstrap 'resources/**/*.es' | |
phpTest: | |
name: 'PHP test (PHP ${{ matrix.php.version }})' | |
strategy: | |
matrix: | |
php: | |
- | |
version: '8.1' | |
experimental: false | |
- | |
version: '8.2' | |
experimental: false | |
- | |
version: '8.3' | |
experimental: true | |
- | |
version: '8.4' | |
experimental: true | |
runs-on: ubuntu-22.04 | |
needs: | |
- makeComposerCache | |
steps: | |
- | |
uses: actions/checkout@v4 | |
- | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/composer/files | |
vendor | |
key: "${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}" | |
- | |
name: 'Set up PHP ${{ matrix.php.version }}' | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '${{ matrix.php.version }}' | |
- | |
name: 'Set up application' | |
run: | | |
ln -s `which composer` composer.phar | |
make config-files vendor | |
- | |
name: 'Set up (migrate) database' | |
run: 'tests/bin/yii migrate/fresh --compact=1 --interactive=0' | |
- | |
name: 'Run unit test' | |
run: 'vendor/bin/codecept run unit' | |
continue-on-error: '${{ matrix.php.experimental }}' |