Skip to content

Commit

Permalink
Optimize ci (#4)
Browse files Browse the repository at this point in the history
* Optimize ci

* Update tests.yml

---------

Co-authored-by: Deeka Wong <[email protected]>
  • Loading branch information
huangdijia and huangdijia committed Feb 3, 2023
1 parent 4f36f3a commit 0b462ef
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: tests

on: [push]
on: [push, pull_request]

env:
PHP_CS_FIXER_IGNORE_ENV: 1

jobs:
build:
Expand All @@ -9,9 +12,10 @@ jobs:
strategy:
max-parallel: 15
matrix:
os: [ubuntu-latest]
php-version: ["8.0", "8.1", "8.2"]
name: PHP ${{ matrix.php-version }} Test on ${{ matrix.os }}
os: [ ubuntu-latest ]
php: [ "8.0", "8.1", "8.2" ]

name: PHP ${{ matrix.php }} Test on ${{ matrix.os }}

steps:
- name: Checkout
Expand All @@ -20,7 +24,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
php-version: ${{ matrix.php }}
extensions: mbstring, redis, pdo, pdo_mysql, bcmath, swoole
tools: phpize
coverage: none
Expand All @@ -35,20 +39,13 @@ jobs:
run: php -m

- name: Install Dependencies
run: |
composer install --dev
run: composer install --dev

- name: Run Cs Fixer
run: |
if [ "${{ matrix.php-version }}" == "8.2" ]; then
PHP_CS_FIXER_IGNORE_ENV=true ./vendor/bin/php-cs-fixer fix $1 --dry-run --diff --verbose --show-progress=dots
else
./vendor/bin/php-cs-fixer fix $1 --dry-run --diff --verbose --show-progress=dots
fi
run: php ./vendor/bin/php-cs-fixer fix $1 --dry-run --diff --verbose --show-progress=dots

- name: Run PHPStan
run: vendor/bin/phpstan analyse --memory-limit 300M -l 0 -c phpstan.neon ./src ./publish
run: php vendor/bin/phpstan analyse --memory-limit 300M -l 0 -c phpstan.neon ./src ./publish

# - name: Run Test
# run: |
# composer test
# run: composer test

0 comments on commit 0b462ef

Please sign in to comment.