lint_c.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: 'Lint C/C++ with clang-format'
  2. on:
  3. push:
  4. branches:
  5. - dev
  6. - "release*"
  7. tags:
  8. - '*'
  9. pull_request:
  10. env:
  11. TARGETS: f7
  12. jobs:
  13. lint_c_cpp:
  14. runs-on: [self-hosted,FlipperZeroShell]
  15. steps:
  16. - name: 'Decontaminate previous build leftovers'
  17. run: |
  18. if [ -d .git ]; then
  19. git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
  20. fi
  21. - name: 'Checkout code'
  22. uses: actions/checkout@v2
  23. with:
  24. fetch-depth: 0
  25. ref: ${{ github.event.pull_request.head.sha }}
  26. - name: 'Check code formatting'
  27. id: syntax_check
  28. run: SET_GH_OUTPUT=1 FBT_TOOLCHAIN_PATH=/runner/_work ./fbt lint
  29. - name: Report code formatting errors
  30. if: failure() && steps.syntax_check.outputs.errors && github.event.pull_request
  31. uses: peter-evans/create-or-update-comment@v1
  32. with:
  33. issue-number: ${{ github.event.pull_request.number }}
  34. body: |
  35. Please fix following code formatting errors:
  36. ```
  37. ${{ steps.syntax_check.outputs.errors }}
  38. ```
  39. You might want to run `./fbt format` for an auto-fix.