lint_c.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. ref: ${{ github.event.pull_request.head.sha }}
  28. - name: 'Check code formatting'
  29. id: syntax_check
  30. run: SET_GH_OUTPUT=1 FBT_TOOLCHAIN_PATH=/opt ./fbt lint
  31. - name: Report code formatting errors
  32. if: failure() && steps.syntax_check.outputs.errors && github.event.pull_request
  33. uses: peter-evans/create-or-update-comment@v1
  34. with:
  35. issue-number: ${{ github.event.pull_request.number }}
  36. body: |
  37. Please fix following code formatting errors:
  38. ```
  39. ${{ steps.syntax_check.outputs.errors }}
  40. ```
  41. You might want to run `./fbt format` for an auto-fix.