info.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: PR Lint keyboards
  2. on:
  3. pull_request:
  4. paths:
  5. - 'keyboards/**'
  6. jobs:
  7. info:
  8. runs-on: ubuntu-latest
  9. container: qmkfm/base_container
  10. steps:
  11. - uses: actions/checkout@v2
  12. with:
  13. fetch-depth: 0
  14. - uses: trilom/file-changes-action@v1.2.4
  15. id: file_changes
  16. with:
  17. output: '\n'
  18. - name: Print info
  19. run: |
  20. git rev-parse --short HEAD
  21. echo ${{ github.event.pull_request.base.sha }}
  22. echo '${{ steps.file_changes.outputs.files}}'
  23. - name: Run qmk info
  24. shell: 'bash {0}'
  25. run: |
  26. QMK_CHANGES=$(echo -e '${{ steps.file_changes.outputs.files}}')
  27. QMK_KEYBOARDS=$(qmk list-keyboards)
  28. exit_code=0
  29. for KB in $QMK_KEYBOARDS; do
  30. KEYBOARD_CHANGES=$(echo "$QMK_CHANGES" | grep -E '^(keyboards/'${KB}'/)')
  31. if [[ -z "$KEYBOARD_CHANGES" ]]; then
  32. # skip as no changes for this keyboard
  33. continue
  34. fi
  35. KEYMAP_ONLY=$(echo "$KEYBOARD_CHANGES" | grep -cv /keymaps/)
  36. if [[ $KEYMAP_ONLY -gt 0 ]]; then
  37. echo "linting ${KB}"
  38. # TODO: info info always returns 0 - right now the only way to know failure is to inspect log lines
  39. qmk info -l -kb ${KB} 2>&1 | tee /tmp/$$
  40. !(grep -cq ☒ /tmp/$$)
  41. : $((exit_code = $exit_code + $?))
  42. fi
  43. done
  44. exit $exit_code