format.yml 659 B

1234567891011121314151617181920212223242526
  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
  19. # Fails the job (and blocks the PR) the moment any file differs from
  20. # the Linux kernel .clang-format style. Run `make format` to fix.
  21. run: make check