name: Psalm

on: [push, pull_request]

jobs:
  psalm:
    name: Psalm on PHP ${{ matrix.php-versions }}
    runs-on: ${{ matrix.operating-system }}
    strategy:
      matrix:
        operating-system: ['ubuntu-latest']
        php-versions: ['8.4']
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-versions }}
          tools: psalm:6
          coverage: none

      - name: Install Composer dependencies
        uses: "ramsey/composer-install@v3"
        with:
          composer-options: --no-dev

      - name: Use New psalm.xml
        run: mv psalm.xml psalm-old.xml && mv psalm-new.xml psalm.xml

      - name: Static Analysis
        run: psalm
