Split cs fix from tests (#5821)

* Split cs fix from tests

* Optimize CI name

* Optimize

---------

Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
This commit is contained in:
Deeka Wong 2023-06-09 14:42:30 +08:00 committed by GitHub
parent 0e745ffeea
commit 9e850b336c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 7 deletions

View File

@ -7,7 +7,28 @@ on:
- cron: '0 2 * * *'
jobs:
ci:
cs-fix:
name: PHP CS Fix on PHP${{ matrix.php }} ${{ matrix.swoole }}
runs-on: ubuntu-latest
strategy:
matrix:
os: [ ubuntu-latest ]
php: [ '8.1' ]
swoole: [ 'swoole']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: php-cs-fixer
extensions: redis, pdo, pdo_mysql, bcmath, ${{ matrix.swoole }}
- name: Setup Packages
run: composer update -oW
- name: Run CS Fix
run: vendor/bin/php-cs-fixer fix src --dry-run
tests:
name: Test on PHP${{ matrix.php-version }} Swoole-${{ matrix.sw-version }}
runs-on: "${{ matrix.os }}"
strategy:
@ -52,7 +73,7 @@ jobs:
php --ri swoole
- name: Setup Packages
run: ./.travis/requirement.install.sh
- name: Run Check
- name: Run PHPStan
run: ./.travis/run.check.sh
- name: Setup Services
run: ./.travis/setup.services.sh

View File

@ -2,9 +2,4 @@
set -e
PHP_VER=$(php -r "echo PHP_VERSION_ID;")
if [ $PHP_VER -ge 80100 ]; then
PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix src --dry-run
fi
composer analyse src