printer-linter-pr-diagnose.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: printer-linter-pr-diagnose
  2. on:
  3. pull_request:
  4. path:
  5. - "resources/**"
  6. permissions:
  7. contents: read
  8. jobs:
  9. printer-linter-diagnose:
  10. name: Printer linter PR diagnose
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Setup the build environment
  14. uses: ultimaker/cura-workflows/.github/actions/setup-build-environment@main
  15. - uses: greguintow/get-diff-action@v7
  16. with:
  17. DIFF_FILTER: AMRCD
  18. PATTERNS: |
  19. resources/+(extruders|definitions)/*.def.json
  20. resources/+(intent|quality|variants)/**/*.inst.cfg
  21. - name: Create results directory
  22. run: mkdir printer-linter-result
  23. - name: Diagnose file(s)
  24. if: env.GIT_DIFF && !env.MATCHED_FILES
  25. run: python printer-linter/src/terminal.py --diagnose --report printer-linter-result/fixes.yml ${{ env.GIT_DIFF_FILTERED }}
  26. - name: Check Deleted Files(s)
  27. if: env.GIT_DIFF
  28. run: python printer-linter/src/terminal.py --deleted --report printer-linter-result/comment.md ${{ env.GIT_DIFF_FILTERED }}
  29. - name: Save PR metadata
  30. run: |
  31. echo ${{ github.event.number }} > printer-linter-result/pr-id.txt
  32. echo ${{ github.event.pull_request.head.repo.full_name }} > printer-linter-result/pr-head-repo.txt
  33. echo ${{ github.event.pull_request.head.sha }} > printer-linter-result/pr-head-sha.txt
  34. - uses: actions/upload-artifact@v4
  35. with:
  36. name: printer-linter-result
  37. path: printer-linter-result/
  38. - name: Run clang-tidy-pr-comments action
  39. uses: platisd/clang-tidy-pr-comments@bc0bb7da034a8317d54e7fe1e819159002f4cc40
  40. with:
  41. github_token: ${{ secrets.GITHUB_TOKEN }}
  42. clang_tidy_fixes: result.yml
  43. request_changes: true