From 2b82a2c769e1ce48f0b28a7a17f2ef7fa02bcb18 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 18 Jan 2024 21:29:59 +0100 Subject: [PATCH] TASK: Run php-stan on ci in Neos 8.3 --- .composer.json | 6 ++++++ .github/workflows/build.yml | 32 ++++++++++---------------------- composer.json | 6 ++++++ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.composer.json b/.composer.json index ba985efacae..48a46ea6ceb 100644 --- a/.composer.json +++ b/.composer.json @@ -6,6 +6,12 @@ "require": { "neos/flow-development-collection": "8.3.x-dev" }, + "scripts": { + "lint:phpstan": "../../bin/phpstan analyse", + "lint": [ + "@lint:phpstan" + ] + }, "replace": { }, "suggest": { diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b37ada09b7e..735d6580ac7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: contents: read # to fetch code (actions/checkout) if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip travis]')" - name: "PHP ${{ matrix.php-versions }} Test ${{ matrix.static-analysis != 'no' && matrix.static-analysis || '' }} (deps: ${{ matrix.dependencies }})" + name: "PHP ${{ matrix.php-versions }} Test ${{ matrix.static-analysis != 'no' && 'static analysis ' || '' }} (deps: ${{ matrix.dependencies }})" continue-on-error: ${{ matrix.experimental }} @@ -26,24 +26,11 @@ jobs: composer-arguments: [''] # to run --ignore-platform-reqs in experimental builds static-analysis: ['no'] experimental: [false] - #include: - #- php-versions: '7.3' - # static-analysis: 'psalm' - # experimental: false - # dependencies: 'highest' - - # Experimental build for PHP nightly - #- php-versions: 'nightly' - # composer-arguments: '--ignore-platform-reqs' - # static-analysis: 'no' - # experimental: true - # dependencies: 'highest' - - # Build for minimum dependencies. Fails right now, hence deactivated. - #- php-versions: '7.1' - # static-analysis: 'no' - # experimental: false - # dependencies: 'lowest' + include: + - php-versions: '8.1' + static-analysis: 'yes' + experimental: false + dependencies: 'highest' runs-on: ubuntu-latest services: @@ -142,6 +129,7 @@ jobs: run: echo "FLOW_CONTEXT=${{ env.FLOW_CONTEXT }}" >> $GITHUB_ENV - name: Setup Flow configuration + if: matrix.static-analysis == 'no' run: | rm -f Configuration/Routes.yaml rm -f Configuration/Testing/Settings.yaml @@ -163,9 +151,9 @@ jobs: ./flow configuration:show ./flow routing:list - #- name: Static analysis - # if: matrix.static-analysis == 'psalm' - # run: composer test-static + - name: Static analysis + if: matrix.static-analysis == 'yes' + run: cd Packages/Neos && composer lint:phpstan - name: Run unit tests if: matrix.static-analysis == 'no' diff --git a/composer.json b/composer.json index 558b54635df..cf827eb47f4 100644 --- a/composer.json +++ b/composer.json @@ -34,6 +34,12 @@ "neos/form": "*", "neos/kickstarter": "~8.3.0" }, + "scripts": { + "lint:phpstan": "../../bin/phpstan analyse", + "lint": [ + "@lint:phpstan" + ] + }, "replace": { "typo3/typo3cr": "self.version", "packagefactory/atomicfusion-afx": "*",