lint_c.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: 'Lint C/C++ with clang-format'
  2. on:
  3. push:
  4. paths:
  5. - '**.h'
  6. - '**.c'
  7. - '**.hpp'
  8. - '**.cpp'
  9. pull_request:
  10. env:
  11. TARGETS: f6
  12. jobs:
  13. lint_c_cpp:
  14. runs-on: [self-hosted]
  15. steps:
  16. - name: 'Cleanup workspace'
  17. uses: AutoModality/action-clean@v1
  18. - name: 'Decontaminate previous build leftovers'
  19. run: |
  20. if [ -d .git ]
  21. then
  22. git submodule status \
  23. || git checkout `git rev-list --max-parents=0 HEAD | tail -n 1`
  24. fi
  25. - name: 'Checkout code'
  26. uses: actions/checkout@v2
  27. with:
  28. fetch-depth: 0
  29. submodules: true
  30. - name: 'Docker cache'
  31. uses: satackey/action-docker-layer-caching@v0.0.11
  32. continue-on-error: true
  33. with:
  34. key: docker-cache-${{ hashFiles('docker/**') }}-{hash}
  35. restore-keys: docker-cache-${{ hashFiles('docker/**') }}-
  36. - name: 'Build docker image'
  37. uses: ./.github/actions/docker
  38. - name: 'Check syntax'
  39. uses: ./.github/actions/docker
  40. continue-on-error: false
  41. with:
  42. run: /syntax_check.sh