-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from greg0ire/split-sa-workflow
Split static analysis workflow
- Loading branch information
Showing
4 changed files
with
60 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
name: "Static Analysis with PHPStan" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
php-version: | ||
description: "The PHP version to use when running the job" | ||
default: "8.3" | ||
required: false | ||
type: "string" | ||
composer-root-version: | ||
description: "The version of the package being tested, in case of circular dependencies." | ||
required: false | ||
type: "string" | ||
composer-options: | ||
description: "Additional flags for the composer install command." | ||
default: "--prefer-dist" | ||
required: false | ||
type: "string" | ||
|
||
jobs: | ||
phpstan: | ||
name: "PHPStan (PHP: ${{ inputs.php-version }})" | ||
runs-on: "ubuntu-22.04" | ||
|
||
steps: | ||
- name: "Checkout code" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "none" | ||
php-version: "${{ inputs.php-version }}" | ||
|
||
- name: "Set COMPOSER_ROOT_VERSION" | ||
run: | | ||
echo "COMPOSER_ROOT_VERSION=${{ inputs.composer-root-version }}" >> $GITHUB_ENV | ||
if: "${{ inputs.composer-root-version }}" | ||
|
||
- name: "Install dependencies with Composer" | ||
uses: "ramsey/composer-install@v3" | ||
with: | ||
dependency-versions: "highest" | ||
composer-options: "${{ inputs.composer-options }}" | ||
|
||
- name: "Run a static analysis with phpstan/phpstan" | ||
run: "vendor/bin/phpstan analyse -v" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
...templates/static-analysis.properties.json → workflow-templates/phpstan.properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
{ | ||
"name": "Static analysis", | ||
"name": "Static analysis with PHPStan", | ||
"description": "Perform static analysis on the source code and tests", | ||
"iconName": "doctrine-logo", | ||
"categories": [ | ||
"PHP" | ||
], | ||
"filePatterns": [ | ||
"^phpstan\\.neon(?:\\.dist)$", | ||
"^psalm\\.xml$" | ||
"^phpstan\\.neon(?:\\.dist)$" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters