jon48/webtrees-lib

View on GitHub
.github/workflows/php-staticanalysis.yaml

Summary

Maintainability
Test Coverage
name: Static analysis PHP

on:
  push:
    branches-ignore:
      - '**-dev'
  pull_request:

jobs:

  phpstan:
    name: phpstan - PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }}

    strategy:
      matrix:
        operating-system: [ubuntu-latest]
        php-version: ['7.4', '8.0', '8.1']

    runs-on: ${{ matrix.operating-system }}

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Setup PHP
        uses: shivammathur/setup-php@master
        with:
          php-version: ${{ matrix.php-version }}
          extensions: gd,intl,mbstring,sqlite,zip
          coverage: disable

      - run: composer global config allow-plugins.phpstan/extension-installer true

      - run: composer global require phpstan/phpstan phpstan/extension-installer phpstan/phpstan-deprecation-rules phpstan/phpstan-strict-rules phpstan/phpstan-phpunit

      - run: composer install --no-progress --no-suggest --ignore-platform-reqs

      - run: ~/.composer/vendor/bin/phpstan analyze --no-progress --error-format=github

  psalm:
    name: psalm - PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }}

    strategy:
      matrix:
        operating-system: [ubuntu-latest]
        php-version: ['7.4', '8.0', '8.1']
        
    runs-on: ${{ matrix.operating-system }}

    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        
      - name: Setup PHP
        uses: shivammathur/setup-php@master
        with:
          php-version: ${{ matrix.php-version }}
          extensions: gd,intl,mbstring,sqlite,zip
          coverage: disable

      - run: composer global require vimeo/psalm
     
      - run: composer install --no-progress --ignore-platform-reqs
     
      - run: ~/.composer/vendor/bin/psalm
      
      - run: ~/.composer/vendor/bin/psalm --taint-analysis