From 21a69efa79df8ac7043aa70479408e168f7ee887 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Mon, 23 Sep 2024 12:13:55 +0200 Subject: [PATCH] update static ci --- .github/workflows/static.yml | 64 +++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 70145885..b94fd509 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -1,7 +1,6 @@ +on: [ pull_request ] name: Static analysis -on: [push, pull_request] - jobs: phpstan: name: PHPStan @@ -9,39 +8,60 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + extensions: apcu, redis + coverage: none + tools: phpstan:1.12, cs2pr - name: Download dependencies - run: | - composer update --no-interaction --prefer-dist --optimize-autoloader + uses: ramsey/composer-install@v2 - name: PHPStan - uses: docker://oskarstark/phpstan-ga - with: - entrypoint: /composer/vendor/bin/phpstan - args: analyze --no-progress + run: phpstan analyze --no-progress --error-format=checkstyle | cs2pr - php-cs-fixer: - name: PHP-CS-Fixer + psalm: + name: Psalm runs-on: ubuntu-latest - steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: PHP-CS-Fixer - uses: docker://oskarstark/php-cs-fixer-ga + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: - args: --dry-run --diff-format udiff + php-version: 8.3 + extensions: apcu, redis + coverage: none + tools: vimeo/psalm:5.26 - psalm: - name: Psalm + - name: Download dependencies + uses: ramsey/composer-install@v2 + + - name: Psalm + run: psalm --no-progress --output-format=github + + php-cs-fixer: + name: PHP-CS-Fixer runs-on: ubuntu-latest + steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Psalm - uses: docker://vimeo/psalm-github-actions + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: - args: --no-progress --show-info=false --stats + php-version: 8.3 + coverage: none + tools: php-cs-fixer:3.64, cs2pr + + - name: Display PHP-CS-Fixer version + run: sleep 1 && php-cs-fixer --version + + - name: PHP-CS-Fixer + run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr