printer-linter-pr-diagnose.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. name: printer-linter-pr-diagnose
  2. on:
  3. pull_request:
  4. path:
  5. - "resources/**"
  6. jobs:
  7. printer-linter-diagnose:
  8. name: Printer linter PR diagnose
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: Checkout
  12. uses: actions/checkout@v3
  13. with:
  14. fetch-depth: 2
  15. - name: Setup Python and pip
  16. uses: actions/setup-python@v4
  17. with:
  18. python-version: 3.11.x
  19. cache: "pip"
  20. cache-dependency-path: .github/workflows/requirements-printer-linter.txt
  21. - uses: technote-space/get-diff-action@v6
  22. with:
  23. PATTERNS: |
  24. resources/+(extruders|definitions)/*.def.json
  25. resources/+(intent|quality|variants)/**/*.inst.cfg
  26. - name: Install Python requirements for runner
  27. if: env.GIT_DIFF && !env.MATCHED_FILES
  28. run: pip install -r .github/workflows/requirements-printer-linter.txt
  29. - name: Create results directory
  30. run: mkdir printer-linter-result
  31. - name: Diagnose file(s)
  32. if: env.GIT_DIFF && !env.MATCHED_FILES
  33. run: python printer-linter/src/terminal.py --diagnose --report printer-linter-result/fixes.yml ${{ env.GIT_DIFF_FILTERED }}
  34. - name: Save PR metadata
  35. run: |
  36. echo ${{ github.event.number }} > printer-linter-result/pr-id.txt
  37. echo ${{ github.event.pull_request.head.repo.full_name }} > printer-linter-result/pr-head-repo.txt
  38. echo ${{ github.event.pull_request.head.ref }} > printer-linter-result/pr-head-ref.txt
  39. - uses: actions/upload-artifact@v2
  40. with:
  41. name: printer-linter-result
  42. path: printer-linter-result/
  43. - name: Run clang-tidy-pr-comments action
  44. uses: platisd/clang-tidy-pr-comments@bc0bb7da034a8317d54e7fe1e819159002f4cc40
  45. with:
  46. github_token: ${{ secrets.GITHUB_TOKEN }}
  47. clang_tidy_fixes: result.yml
  48. request_changes: true