name: style-check

on: [push, pull_request]

env:
  BUILD_HOST: ubuntu-22.04
  USERNAME: github-actions

jobs:
  check-cpp-formatting:
    name: Check C++ Formatting
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
    - uses: actions/checkout@v4
    - uses: DoozyX/clang-format-lint-action@v0.16
      with:
        source: '.'
        exclude: './ci/flatpak'
        extensions: 'h,hpp,cpp,cc,cc.in'
        clangFormatVersion: 12

  check-cmake-formatting:
    name: Check CMakeLists Formatting
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
    - uses: actions/checkout@v4
    - uses: PuneetMatharu/cmake-format-lint-action@v1.0.4
      with:
        args: --config-files .cmake-format --check