mirror of
https://github.com/snipe/snipe-it.git
synced 2026-08-18 11:15:42 +00:00
56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
name: Static Analysis
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- develop
|
|
pull_request:
|
|
|
|
jobs:
|
|
analyse:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
php-version:
|
|
- "8.5"
|
|
|
|
name: PHP ${{ matrix.php-version }}
|
|
|
|
steps:
|
|
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
|
|
with:
|
|
php-version: "${{ matrix.php-version }}"
|
|
coverage: none
|
|
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Get Composer Cache Directory
|
|
id: composer-cache
|
|
run: |
|
|
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
|
|
|
- uses: actions/cache@v6
|
|
with:
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ matrix.php-version }}-composer-
|
|
|
|
- name: Install Dependencies
|
|
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
|
|
|
# PHPStan analyses types / dead code / undefined properties, PHPMD covers
|
|
# the classes PHPStan doesn't (unused parameters, unused locals). Both
|
|
# honor their baselines so this job only fails on NEW findings, not the
|
|
# 3400+ pre-existing ones inherited from before analyzer adoption.
|
|
- name: PHPStan
|
|
run: composer analyse:phpstan
|
|
|
|
- name: PHPMD
|
|
run: composer analyse:phpmd
|