Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH Actions/reusable-phpstan.yml: add "version" configurable option #2

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/reusable-phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: PHPStan

on:
workflow_call:
inputs:
version:
description: "The PHPStan version to use. Defaults to the latest available version."
type: string
required: false
default: ""

jobs:
phpstan:
Expand All @@ -18,13 +24,22 @@ jobs:
with:
files: "phpstan.neon*"

- name: Create tools string
id: tools
run: |
if [ "${{ inputs.version }}" == "" ]; then
echo 'TOOLS=phpstan' >> "$GITHUB_OUTPUT"
else
echo 'TOOLS=phpstan:${{ inputs.version }}' >> "$GITHUB_OUTPUT"
fi

- name: Install PHP
if: ${{ steps.has_config.outputs.files_exists == 'true' }}
uses: shivammathur/setup-php@v2
with:
php-version: 'latest'
coverage: none
tools: phpstan
tools: ${{ steps.tools.outputs.TOOLS }}

# Install dependencies and handle caching in one go.
# Dependencies need to be installed to make sure the PHPUnit classes are recognized.
Expand Down