fmt/.github/workflows/lint.yml
Victor Zverovich e60274b29c Run lint workflow on all PRs to fix stuck required checks
The lint workflow was path-filtered to source files, so PRs that didn't
touch them never ran clang-format/cmake-format. Since those checks are
required, such PRs were blocked forever waiting for a status that never
came. Drop the paths filter so the workflow always reports a status.
2026-06-09 15:56:50 +02:00

46 lines
1.3 KiB
YAML

name: lint
on:
pull_request:
permissions:
contents: read
jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Install clang-format
run: |
sudo install -D -m 0644 support/llvm-snapshot.gpg.key \
/etc/apt/keyrings/apt.llvm.org.asc
codename=$(lsb_release -cs)
echo "deb [signed-by=/etc/apt/keyrings/apt.llvm.org.asc]" \
"https://apt.llvm.org/$codename/" \
"llvm-toolchain-$codename-21 main" \
| sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get install -y clang-format-21
- name: Run clang-format
run: |
find include src -name '*.h' -o -name '*.cc' | \
xargs clang-format-21 -i -style=file -fallback-style=none
git diff --exit-code
cmake-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Install cmake-format
run: pip install --require-hashes -r support/cmake-format-requirements.txt
- name: Run cmake-format
run: |
find . -name CMakeLists.txt -o -name '*.cmake' | \
xargs cmake-format -i
git diff --exit-code