format.yml 750 B

12345678910111213141516171819202122232425262728
  1. name: Format
  2. on:
  3. push:
  4. branches:
  5. - main
  6. # PRs get the same gate -- without this the checks only ran after merge.
  7. pull_request:
  8. jobs:
  9. clang-format:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Check out repository
  13. uses: actions/checkout@v7
  14. - name: Install clang-format
  15. # Pinned to 18 so CI matches the version contributors run locally;
  16. # clang-format output differs between major versions.
  17. run: |
  18. sudo apt-get update
  19. sudo apt-get install -y clang-format-18
  20. - name: Check formatting
  21. # Fails the job (and blocks the PR) the moment any file differs from
  22. # the Linux kernel .clang-format style. Run `make format` to fix.
  23. run: make check