name: Validate C++

on:
  push:
    branches:
      - main
    paths:
      - '.github/workflows/validate-cpp.yml'
      - 'package/cpp/**'
      - 'package/android/src/main/cpp/**'
      - 'package/ios/**'
  pull_request:
    paths:
      - '.github/workflows/validate-cpp.yml'
      - 'package/cpp/**'
      - 'package/android/src/main/cpp/**'
      - 'package/ios/**'

jobs:
  lint:
    name: Check clang-format
    runs-on: ubuntu-latest
    strategy:
      matrix:
        path:
          - 'package/cpp'
          - 'package/android/src/main/cpp'
          - 'package/ios'
    steps:
      - uses: actions/checkout@v4
      - name: Run clang-format style check
        uses: mrousavy/clang-format-action@v1
        with:
          clang-format-version: '16'
          check-path: ${{ matrix.path }}
          clang-format-style-path: package/cpp/.clang-format

