lint_c.yml 1.0 KB

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