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

GitHub Action: how to setup --min-* and PR annotations together #624

Open
Aerendir opened this issue Feb 16, 2023 · 0 comments
Open

GitHub Action: how to setup --min-* and PR annotations together #624

Aerendir opened this issue Feb 16, 2023 · 0 comments

Comments

@Aerendir
Copy link

Q A
Bug report? no
Feature request? no
Library version 2.7.0

Hello, I'm trying to setup PHP Insights in my CI flow.

I have this setup:

name: PHP Insights

on: [ push ]

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
    # The concurrency group contains the workflow name and the branch name.
    group: ${{ github.workflow }}-${{ github.ref }}
    cancel-in-progress: true

jobs:
    phpinsights:
        runs-on: ${{ matrix.os }}
        strategy:
            fail-fast: false
            matrix:
                os: [ ubuntu-latest ]
                php: [ '8.1' ]

        env:
            COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
            APP_ENV: test

        steps:
            -   name: Checkout
                uses: actions/checkout@v3

            -   name: Setup PHP
                uses: shivammathur/setup-php@2.24.0
                with:
                    php-version: ${{ matrix.php }}
                    coverage: none # disable xdebug, pcov
                    extensions: intl, oauth

            -   name: Install Composer deps
                uses: ramsey/composer-install@v2
                with:
                    composer-options: --no-scripts

            -   name: Install Composer bin PHP Insights
                uses: ramsey/composer-install@v2
                with:
                    working-directory: './vendor-bin/phpinsights'
          
            # When upgrading here, upgrade `bin/validate`, too
            -   name: Run PHP Insights
                run: |
                  ./vendor-bin/phpinsights/vendor/bin/phpinsights analyse --composer=./composer.json --no-interaction --min-quality=70 --min-complexity=83 --min-architecture=55 --ansi --format=github-action

My intention is to check for the minimum values I want be respected and to annotate the PR with the found errors.

It seems this config doesn't work as the action simply fails and the PR is not annotated.

For sure I'm doing something wrong: can you, please, help me set the correct configuration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant