name: PHP Lint

concurrency:
  group: ${{ github.ref }}
  cancel-in-progress: true

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  phplint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up PHP
        # Use a released version that is available on GitHub Actions marketplace.
        # shivammathur/setup-php@v2 is a stable tag supported widely.
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.2'
      - name: Run php -l on theme file
        run: |
          set -e
          echo "Checking rit_bs5.theme"
          php -l web/themes/rit_bs5/rit_bs5.theme