Improve trigger config (#813) #7360
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: tests | |
on: | |
push: | |
paths: | |
- "**" | |
- "!docs/**" | |
- "!.vscode/**" | |
- "!**.md" | |
pull_request: | |
paths: | |
- "**" | |
- "!docs/**" | |
- "!.vscode/**" | |
- "!**.md" | |
schedule: | |
- cron: '0 2 * * *' | |
env: | |
PHP_CS_FIXER_IGNORE_ENV: 1 | |
jobs: | |
cs-fix: | |
name: PHP CS Fixer on PHP ${{ matrix.php }} | |
runs-on: "${{ matrix.os }}" | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
php: ['8.1'] | |
max-parallel: 20 | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: redis, pdo, pdo_mysql, bcmath, swoole | |
tools: phpize | |
coverage: none | |
- name: Setup Packages | |
run: composer update -o | |
- name: Check Composer Json | |
run: | | |
composer normalize --dry-run --no-update-lock | |
find ./src -name composer.json -exec composer normalize --dry-run --no-update-lock {} \; | |
- name: Run Cs Fixer | |
run: vendor/bin/php-cs-fixer fix $1 --dry-run --diff --verbose | |
tests: | |
needs: cs-fix | |
name: Test on PHP ${{ matrix.php }} with Swoole ${{ matrix.swoole }} | |
runs-on: "${{ matrix.os }}" | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
php: ['8.3', '8.2', '8.1'] | |
swoole: ['5.1.6', '6.0.0'] | |
# exclude: | |
# - php: '8.3' | |
# swoole: '5.0.3' | |
max-parallel: 20 | |
fail-fast: false | |
env: | |
SW_VERSION: ${{ matrix.swoole }} | |
PHP_VERSION: ${{ matrix.php }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: redis, pdo, pdo_mysql, bcmath ,swoole-${{ matrix.swoole }} | |
tools: phpize | |
coverage: none | |
# - name: Setup Swoole | |
# run: ./.travis/setup.swoole.sh | |
- name: Show PHP Information | |
run: php -v && php --ri swoole | |
- name: Setup Dependencies | |
run: composer update -o | |
- name: Run Analyse | |
run: composer analyse src | |
- name: Setup Services | |
run: ./.travis/setup.services.sh | |
- name: Run Test Cases | |
run: php vendor/bin/pest --parallel |