File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -159,3 +159,45 @@ jobs:
159159 if [ -f /tmp/phpcs-checkstyle-report.xml ]; then
160160 cs2pr /tmp/phpcs-checkstyle-report.xml
161161 fi
162+
163+ phpstan : # ----------------------------------------------------------------------
164+ name : PHPStan
165+ runs-on : ubuntu-latest
166+
167+ steps :
168+ - name : Check out source code
169+ uses : actions/checkout@v4
170+
171+ - name : Check existence of composer.json & phpcs.xml.dist files
172+ id : check_files
173+ uses : andstor/file-existence-action@v3
174+ with :
175+ files : " composer.json"
176+
177+ - name : Set up PHP environment
178+ if : steps.check_files.outputs.files_exists == 'true'
179+ uses : shivammathur/setup-php@v2
180+ with :
181+ php-version : ' latest'
182+ tools : cs2pr
183+ env :
184+ COMPOSER_TOKEN : ${{ secrets.GITHUB_TOKEN }}
185+
186+ - name : Install Composer dependencies & cache dependencies
187+ if : steps.check_files.outputs.files_exists == 'true'
188+ uses : " ramsey/composer-install@v3"
189+ env :
190+ COMPOSER_ROOT_VERSION : dev-${{ github.event.repository.default_branch }}
191+ with :
192+ # Bust the cache at least once a month - output format: YYYY-MM.
193+ custom-cache-suffix : $(date -u "+%Y-%m")
194+
195+ - name : Check existence of vendor/bin/phpstan file
196+ id : check_phpstan_binary_file
197+ uses : andstor/file-existence-action@v3
198+ with :
199+ files : " vendor/bin/phpstan"
200+
201+ - name : Run PHPStan
202+ if : steps.check_phpstan_binary_file.outputs.files_exists == 'true'
203+ run : composer phpstan
You can’t perform that action at this time.
0 commit comments