|
| 1 | +--- |
| 2 | + |
| 3 | +on: # yamllint disable-line rule:truthy |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - develop |
| 8 | + paths: |
| 9 | + - 'app/config/**' |
| 10 | + - 'app/src/**' |
| 11 | + - 'app/tests/**' |
| 12 | + - 'app/.php-cs-fixer.dist.php' |
| 13 | + - 'app/composer.json' |
| 14 | + - 'app/composer.lock' |
| 15 | + - 'app/phpstan.neon.dist' |
| 16 | + - 'app/phpstan-baseline.neon' |
| 17 | + - 'app/psalm.xml' |
| 18 | + - 'app/psalm-baseline.xml' |
| 19 | + |
| 20 | +name: 🔍 Static analysis |
| 21 | + |
| 22 | +env: |
| 23 | + # Disable docker support in Makefile |
| 24 | + APP_RUNNER: 'cd app &&' |
| 25 | + |
| 26 | +jobs: |
| 27 | + stan: |
| 28 | + timeout-minutes: 4 |
| 29 | + runs-on: ${{ matrix.os }} |
| 30 | + concurrency: |
| 31 | + cancel-in-progress: true |
| 32 | + group: stan-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 33 | + strategy: |
| 34 | + fail-fast: true |
| 35 | + matrix: |
| 36 | + os: |
| 37 | + - ubuntu-latest |
| 38 | + php-version: |
| 39 | + - '8.3' |
| 40 | + dependencies: |
| 41 | + - locked |
| 42 | + steps: |
| 43 | + - name: 📦 Check out the codebase |
| 44 | + |
| 45 | + |
| 46 | + - name: 🛠️ Setup PHP |
| 47 | + uses: shivammathur/[email protected] |
| 48 | + with: |
| 49 | + php-version: ${{ matrix.php-version }} |
| 50 | + extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql |
| 51 | + ini-values: error_reporting=E_ALL |
| 52 | + coverage: none |
| 53 | + |
| 54 | + - name: 🛠️ Setup problem matchers |
| 55 | + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
| 56 | + |
| 57 | + - name: 🤖 Validate composer.json and composer.lock |
| 58 | + run: make validate-composer |
| 59 | + |
| 60 | + - name: 🔍 Get composer cache directory |
| 61 | + uses: wayofdev/gh-actions/actions/composer/[email protected] |
| 62 | + with: |
| 63 | + working-directory: app |
| 64 | + |
| 65 | + - name: ♻️ Restore cached dependencies installed with composer |
| 66 | + |
| 67 | + with: |
| 68 | + path: ${{ env.COMPOSER_CACHE_DIR }} |
| 69 | + key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }} |
| 70 | + restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- |
| 71 | + |
| 72 | + - name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer |
| 73 | + uses: wayofdev/gh-actions/actions/composer/[email protected] |
| 74 | + with: |
| 75 | + working-directory: app |
| 76 | + dependencies: ${{ matrix.dependencies }} |
| 77 | + |
| 78 | + - name: 🔍 Run static analysis using phpstan/phpstan |
| 79 | + run: make lint-stan-ci |
0 commit comments