From bdbc87a6c20eee6da8ed4096a5445bcc8a901119 Mon Sep 17 00:00:00 2001 From: overtrue Date: Fri, 4 Mar 2022 10:29:57 +0800 Subject: [PATCH] add workflow --- .github/workflows/lint.yml | 23 +++++++++++++++++++++++ .github/workflows/test.yml | 22 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..af119e1 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,23 @@ +name: Lint +on: [push, pull_request] + +jobs: + phpstan: + name: PHPStan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Install Dependencies + run: composer install --no-progress + - name: Run PHPStan + run: ./vendor/bin/phpstan analyse --no-progress + + php_cs_fixer: + name: PHP-CS-Fxier + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Install Dependencies + run: composer install --no-progress + - name: Run PHP-CS-Fxier + run: composer check-style diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7d5a26e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,22 @@ +name: Test +on: [push, pull_request] + +jobs: + phpunit: + name: PHP-${{ matrix.php_version }}-${{ matrix.perfer }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php_version: + - 8.0 + - 8.1 + perfer: + - stable + - lowest + steps: + - uses: actions/checkout@master + - name: Install Dependencies + run: composer update --prefer-dist --no-interaction --no-suggest --prefer-${{ matrix.perfer }} + - name: Run PHPUnit + run: ./vendor/bin/phpunit