Skip to content

Commit

Permalink
GH Actions: split off Psalm to separate workflow
Browse files Browse the repository at this point in the history
Psalm does not need to be run against multiple PHP versions. Running it once should be enough.

With that in mind, this commit:
* Introduces a separate, dedicated workflow which only installs and runs Psalm.
* Removes the Psalm related steps from the `CI` workflow.
* Removes Psalm from the `tools` setting for `setup-php`.
  • Loading branch information
jrfnl committed Aug 8, 2021
1 parent 6ab88bd commit 64256a0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl
ini-values: post_max_size=256M, max_execution_time=180
tools: psalm, phpunit:${{ matrix.phpunit-versions }}
tools: phpunit:${{ matrix.phpunit-versions }}
coverage: none

- name: Use Composer 1.x
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, sodium
ini-values: post_max_size=256M, max_execution_time=180
tools: psalm, phpunit:${{ matrix.phpunit-versions }}
tools: phpunit:${{ matrix.phpunit-versions }}
coverage: none

- name: Modernize dependencies
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, sodium
ini-values: post_max_size=256M, max_execution_time=180
tools: psalm, phpunit:${{ matrix.phpunit-versions }}
tools: phpunit:${{ matrix.phpunit-versions }}
coverage: none

- name: Modernize dependencies
Expand All @@ -100,9 +100,3 @@ jobs:
timeout-minutes: 30
with:
memory_limit: 256M

- name: Install Psalm
run: rm composer.lock && composer require --dev vimeo/psalm:^4

- name: Static Analysis
run: vendor/bin/psalm
30 changes: 30 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Psalm

on: [push]

jobs:
psalm:
name: Psalm on PHP ${{ matrix.php-versions }}
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['7.4']
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: psalm:4
coverage: none

- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"
with:
composer-options: --no-dev

- name: Static Analysis
run: psalm

0 comments on commit 64256a0

Please sign in to comment.