xref: /webtrees/.github/workflows/phpcs.yaml (revision afa2be9059e78fc240612c1f8656ff15741ec792)
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']
147c7db574SGreg Roach        php-version: ['8.1', '8.2', '8.3', '8.4']
15*afa2be90SGreg 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 }}
2134ed513fSGreg Roach
227c7db574SGreg Roach      - uses: actions/checkout@v4
239b152ff9SGreg Roach
24b6017f99SGreg Roach      - run: composer validate
25b6017f99SGreg Roach
26b6017f99SGreg Roach      - run: composer global require squizlabs/php_codesniffer
279b152ff9SGreg Roach
289b152ff9SGreg Roach      - name: PHP
293028bd71SGreg Roach        run: ~/.composer/vendor/bin/phpcs --colors --standard=PSR12 --exclude=Generic.Files.LineLength --extensions=php index.php app tests
309b152ff9SGreg Roach
319b152ff9SGreg Roach      - name: Style sheets
329b152ff9SGreg Roach        run: ~/.composer/vendor/bin/phpcs --colors --extensions=css resources/css
33