From 856d2d0e52e114da8fd48dfd6ecd70876dac5f59 Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Fri, 17 Nov 2023 13:15:15 +0100 Subject: [PATCH] add phpstan action --- .github/workflows/php-cs-fixer.yml | 2 +- .github/workflows/phpstan.yml | 26 ++++++++++++++++++++++++++ .github/workflows/run-tests.yml | 6 ++---- phpstan.neon.dist | 2 +- 4 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/phpstan.yml diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index f0beab36..5b872537 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -18,6 +18,6 @@ jobs: args: --config=.php_cs.dist.php --allow-risky=yes - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Fix styling diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 00000000..9979744a --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,26 @@ +name: PHPStan + +on: + push: + paths: + - '**.php' + - 'phpstan.neon.dist' + +jobs: + phpstan: + name: phpstan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + coverage: none + + - name: Install composer dependencies + uses: ramsey/composer-install@v2 + + - name: Run PHPStan + run: ./vendor/bin/phpstan --error-format=github diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e56b1478..fcbe33b2 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -6,7 +6,7 @@ jobs: test: runs-on: ${{ matrix.os }} strategy: - fail-fast: false + fail-fast: true matrix: os: [ubuntu-latest] php: [8.3, 8.2, 8.1, 8.0] @@ -21,7 +21,7 @@ jobs: carbon: ^2.63 exclude: - laravel: 10.* - php: 8.0 + php: 8.0 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} @@ -48,8 +48,6 @@ jobs: --health-retries 5 steps: - - - name: Checkout code uses: actions/checkout@v4 diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 81d214fd..c590d9e3 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,6 +1,6 @@ includes: - ./vendor/nunomaduro/larastan/extension.neon -# - phpstan-baseline.neon + - phpstan-baseline.neon parameters: