diff --git a/.github/workflows/code-analysis.yml b/.github/workflows/code-analysis.yml new file mode 100644 index 0000000..d0e070e --- /dev/null +++ b/.github/workflows/code-analysis.yml @@ -0,0 +1,28 @@ +name: Code Analysis + +on: + push: + paths: + - '**.php' + - 'phpstan.neon.dist' + - '.github/workflows/code-analysis.yml' + +jobs: + phpstan: + name: PHPStan + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + coverage: none + + - name: Install composer dependencies + uses: ramsey/composer-install@v3 + + - name: Run PHPStan + run: ./vendor/bin/phpstan --memory-limit=-1 --error-format=github diff --git a/.github/workflows/code-styling.yml b/.github/workflows/code-styling.yml new file mode 100644 index 0000000..652ea24 --- /dev/null +++ b/.github/workflows/code-styling.yml @@ -0,0 +1,29 @@ +name: Code Styling + +on: + push: + paths: + - '**.php' + +permissions: + contents: write + +jobs: + pint: + name: Pint + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + + - name: Fix PHP code style issues + uses: aglipanci/laravel-pint-action@2.4 + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Fix styling diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml deleted file mode 100644 index 907bddb..0000000 --- a/.github/workflows/formats.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Formats - -on: ['push', 'pull_request'] - -jobs: - ci: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: true - matrix: - os: [ubuntu-latest] - php: [8.2] - dependency-version: [prefer-lowest, prefer-stable] - - name: Formats P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} - - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Cache dependencies - uses: actions/cache@v4 - with: - path: ~/.composer/cache/files - key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, mbstring, zip - tools: prestissimo - coverage: pcov - - - name: Install Composer dependencies - run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist - - - name: Coding Style Checks - run: composer test:lint - - - name: Type Checks - run: composer test:types