xref: /webtrees/.github/workflows/phpcs.yaml (revision 19ceb1bc4b5b6e1e7a341159091659fb6881acdf)
19b152ff9SGreg Roachname: Code style
29b152ff9SGreg Roach
39b152ff9SGreg Roachon: [push, pull_request]
49b152ff9SGreg Roach
59b152ff9SGreg Roachjobs:
69b152ff9SGreg Roach  run:
7b408d467SGreg Roach    if: ${{ !startsWith(github.event.head_commit.message, 'Translation:') }}
865420c9cSGreg Roach    runs-on: ${{ matrix.operating-system }}
99b152ff9SGreg Roach    name: PHP/PHTML/CSS
109b152ff9SGreg Roach
1165420c9cSGreg Roach    strategy:
1265420c9cSGreg Roach      matrix:
1365420c9cSGreg Roach        operating-system: ['ubuntu-latest']
14*19ceb1bcSGreg Roach        php-version: ['8.2', '8.3', '8.4']
15afa2be90SGreg Roach      fail-fast: false
1665420c9cSGreg Roach
179b152ff9SGreg Roach    steps:
1834ed513fSGreg Roach      - uses: shivammathur/setup-php@master
1934ed513fSGreg Roach        with:
2034ed513fSGreg Roach          php-version: ${{ matrix.php-version }}
215666a2e2SGreg Roach          ini-file: 'development'
2234ed513fSGreg Roach
237c7db574SGreg Roach      - uses: actions/checkout@v4
249b152ff9SGreg Roach
25b6017f99SGreg Roach      - run: composer validate
26b6017f99SGreg Roach
27b6017f99SGreg Roach      - run: composer global require squizlabs/php_codesniffer
289b152ff9SGreg Roach
299b152ff9SGreg Roach      - name: PHP
303028bd71SGreg Roach        run: ~/.composer/vendor/bin/phpcs --colors --standard=PSR12 --exclude=Generic.Files.LineLength --extensions=php index.php app tests
319b152ff9SGreg Roach
329b152ff9SGreg Roach      - name: Style sheets
339b152ff9SGreg Roach        run: ~/.composer/vendor/bin/phpcs --colors --extensions=css resources/css
34