From 30ce6196b8979fbc00b0a12f29050239f9659c1d Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Wed, 17 Feb 2021 17:26:34 +0100 Subject: Add phpstan plugins remove leftovers from psalm move phpstan and phpcs to static code check Signed-off-by: Benjamin Brahmer --- .github/workflows/api-php-static-code-check.yml | 51 +++++++++++++++++++++++++ .github/workflows/api-php-tests.yml | 6 --- 2 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/api-php-static-code-check.yml (limited to '.github') diff --git a/.github/workflows/api-php-static-code-check.yml b/.github/workflows/api-php-static-code-check.yml new file mode 100644 index 000000000..cefac1657 --- /dev/null +++ b/.github/workflows/api-php-static-code-check.yml @@ -0,0 +1,51 @@ +name: Static analysis +on: + pull_request +jobs: + static-phpstan-analysis: + runs-on: ubuntu-latest + continue-on-error: true + strategy: + matrix: + php-versions: [ '7.4' ] + nextcloud: [ 'stable21' ] + database: [ 'sqlite' ] + name: "phpstan: Nextcloud ${{ matrix.nextcloud }}" + steps: + - name: Checkout + uses: actions/checkout@master + - name: Set up php + uses: shivammathur/setup-php@master + with: + php-version: 7.4 + extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip + coverage: none + + - name: Set up server non MySQL + uses: SMillerDev/nextcloud-actions/setup-nextcloud@main + with: + cron: true + version: ${{ matrix.nextcloud }} + database-type: ${{ matrix.database }} + + - name: Build app + run: make + + - name: Configure server with app + uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@main + with: + app: 'news' + check-code: true + force: true + + - name: Prep code scanning + working-directory: ../server/apps/news + run: make php-test-dependencies + + - name: PHPCS + working-directory: ../server/apps/news + run: pwd && make phpcs #debug pwd + + - name: PHPStan + working-directory: ../server/apps/news + run: make phpstan \ No newline at end of file diff --git a/.github/workflows/api-php-tests.yml b/.github/workflows/api-php-tests.yml index fa4d4a9dd..2a152480b 100644 --- a/.github/workflows/api-php-tests.yml +++ b/.github/workflows/api-php-tests.yml @@ -47,12 +47,6 @@ jobs: - name: Prep PHP tests working-directory: ../server/apps/news run: make php-test-dependencies - - name: PHPCS - working-directory: ../server/apps/news - run: make phpcs - - name: PHPStan - working-directory: ../server/apps/news - run: make phpstan - name: Unittests working-directory: ../server/apps/news run: make unit-test -- cgit v1.2.3