name: "Coding Standards"

on:
  pull_request:
    branches:
      - "v*.*"
      - "master"
      - "feature/*"
  push:
    branches:
      - "v*.*"
      - "master"
      - "feature/*"

jobs:
  coding-standards:
    name: "Coding Standards"
    runs-on: "ubuntu-20.04"

    strategy:
      matrix:
        php-version:
          - "7.4"

    steps:
      - name: "Checkout"
        uses: "actions/checkout@v3"
        with:
          submodules: true

      - name: "Install PHP"
        uses: "shivammathur/setup-php@v2"
        with:
          php-version: "${{ matrix.php-version }}"
          tools: "phpize"

      - name: "Configure driver"
        run: .github/workflows/configure.sh

      - name: "Run clang-format"
        run: "make format-check"
