lint_c.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 ]
  19. then
  20. git submodule status \
  21. || git checkout `git rev-list --max-parents=0 HEAD | tail -n 1`
  22. fi
  23. - name: 'Checkout code'
  24. uses: actions/checkout@v2
  25. with:
  26. fetch-depth: 0
  27. - name: 'Check code formatting'
  28. id: syntax_check
  29. run: SET_GH_OUTPUT=1 FBT_TOOLCHAIN_PATH=/opt ./fbt lint
  30. - name: Report code formatting errors
  31. if: failure() && steps.syntax_check.outputs.errors && github.event.pull_request
  32. uses: peter-evans/create-or-update-comment@v1
  33. with:
  34. issue-number: ${{ github.event.pull_request.number }}
  35. body: |
  36. Please fix following code formatting errors:
  37. ```
  38. ${{ steps.syntax_check.outputs.errors }}
  39. ```
  40. You might want to run `./fbt format` for an auto-fix.