Skip to content

Better typehinting

Better typehinting #8

Workflow file for this run

name: Code styling
on:
push:
branches:
- main
- 0.x
- 1.x
paths:
- '**.php'
pull_request:
branches:
- main
- 0.x
- 1.x
paths:
- '**.php'
jobs:
format:
name: Run code formatters and analysis
runs-on: ubuntu-latest
steps:
- name: πŸ“š Checkout code
uses: actions/checkout@v3
- name: πŸ”₯ Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none
tools: cs2pr
- name: πŸ“¦ Install Composer dependencies
uses: ramsey/composer-install@v2
- name: πŸ’Ύ Cache Laravel Pint results
uses: actions/cache@v3
env:
cache-name: cache-pint
with:
path: .php-cs-fixer.cache
key: ${{ github.repository }}-${{ env.cache-name }}-${{ github.sha }}
restore-keys: |
${{ github.repository }}-${{ env.cache-name }}-
- name: πŸ’Ύ Cache PHPStan results
uses: actions/cache@v3
env:
cache-name: cache-phpstan
with:
path: /tmp/phpstan/resultCache.php
key: ${{ github.repository }}-${{ env.cache-name }}-${{ github.sha }}
restore-keys: |
${{ github.repository }}-${{ env.cache-name }}-
- name: πŸ“ Run linting
id: run-pint
run: composer lint -- --test
- name: πŸ“ Generate annotations for linting
if: failure() && steps.run-pint.outcome != 'success'
run: composer lint -- --test --format=checkstyle | cs2pr
- name: 🧐 Run static analysis
run: composer analyse -- --error-format=github --no-ansi --no-progress