openvk/.github/workflows/analyse.yaml
Alexander Minkin def76226b7
feat(core): add phpstan for static analysis (#1223)
* feat: add phpstan for static analysis

* ci(actions): add phpstan action

* ci(actions): do analysing inside docker container

* fix(FetchToncoinTransactions): add var declaration

* fix(ServiceAPI/Wall): add var declaration

* fix(bootstrap): remove case-insensitive false vars

* fix(VKAPI/Handlers/Board): change parameters order

* fix(VKAPIRequestHandler): set fail's return type as never

* fix(VKAPI/Handlers/Groups): add array declaration

* fix(VKAPI/Handlers/Newsfeed): add return_banned declaration

* fix(VKAPI/Handlers/Notes): move $nodez declaration up

* fix(phpstan): most of the things and stupid lines of code

* fix(lint)

* fix(phpstan): less errors

* fix(lint): again. cuz i forgot about it

* fix(stan): all errors are gone now =3

---------

Co-authored-by: veselcraft <veselcraft@icloud.com>
2025-03-09 16:03:33 +03:00

36 lines
1.1 KiB
YAML

name: Static analysis
on:
push:
pull_request:
jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-20.04
# 'push' runs on inner branches, 'pull_request' will run only on outer PRs
if: >
github.event_name == 'push'
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Code Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and start Docker container
working-directory: install/automated/docker
run: |
docker build -t openvk ../../.. -f openvk.Dockerfile
- name: Run Docker container with PHPStan
working-directory: install/automated/docker
run: |
docker container run --rm \
-v ./chandler.example.yml:/opt/chandler/chandler.yml \
-v ./openvk.example.yml:/opt/chandler/extensions/available/openvk/openvk.yml \
openvk vendor/bin/phpstan analyse --memory-limit 1G