mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-24 09:05:34 +08:00
Enhancement for integration-test.yml
let commandline cs-fixer follow the configuration
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Build
|
name: Increment Build Number
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
40
.github/workflows/integration-test.yml
vendored
40
.github/workflows/integration-test.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Integration Test
|
name: Integration and Style Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -61,5 +61,41 @@ jobs:
|
|||||||
- name: Run Static Analysis
|
- name: Run Static Analysis
|
||||||
run: "composer analyse"
|
run: "composer analyse"
|
||||||
|
|
||||||
|
- name: Run PHPUnit
|
||||||
|
run: "composer test"
|
||||||
|
|
||||||
|
cs-check:
|
||||||
|
name: PHP CS Fixer Check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup PHP 7.2
|
||||||
|
uses: "shivammathur/setup-php@v2"
|
||||||
|
with:
|
||||||
|
php-version: "7.2"
|
||||||
|
extensions: swoole, posix, json
|
||||||
|
|
||||||
|
- name: Setup problem matchers for PHP
|
||||||
|
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
|
||||||
|
|
||||||
|
- name: Validate composer.json
|
||||||
|
run: "composer validate --strict"
|
||||||
|
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composer-cache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
|
||||||
|
- name: Install Composer Dependencies
|
||||||
|
run: "composer install --prefer-dist --no-progress --optimize-autoloader"
|
||||||
|
|
||||||
- name: Run PHP CS Fixer Check
|
- name: Run PHP CS Fixer Check
|
||||||
run: "./vendor/bin/php-cs-fixer fix --dry-run --diff"
|
run: "composer cs-fix -- --dry-run --diff"
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
"[ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/cghooks add"
|
"[ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/cghooks add"
|
||||||
],
|
],
|
||||||
"analyse": "phpstan analyse --memory-limit 300M",
|
"analyse": "phpstan analyse --memory-limit 300M",
|
||||||
"cs-fix": "php-cs-fixer fix $1",
|
"cs-fix": "php-cs-fixer fix",
|
||||||
"test": "bin/phpunit-swoole --no-coverage"
|
"test": "bin/phpunit-swoole --no-coverage"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user