format.yml 800 B

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