format.yml 811 B

12345678910111213141516171819202122232425262728
  1. name: Format
  2. on:
  3. push:
  4. branches:
  5. - main
  6. jobs:
  7. clang-format:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Check out repository
  11. uses: actions/checkout@v4
  12. - name: Install clang-format
  13. # Pinned to 18 so CI matches the version contributors run locally;
  14. # clang-format output differs between major versions.
  15. run: |
  16. sudo apt-get update
  17. sudo apt-get install -y clang-format-18
  18. - name: Check formatting and style
  19. # Fails the job (and blocks the PR) the moment any file differs from
  20. # the Linux kernel .clang-format style, or a long trailing // comment
  21. # is found. Run `make format` to fix formatting; move long trailing
  22. # comments above their statement to satisfy the lint.
  23. run: make check