You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.2 KiB

  1. name: PR Lint keyboards
  2. on:
  3. pull_request:
  4. paths:
  5. - 'keyboards/**'
  6. jobs:
  7. lint:
  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 lint
  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. qmk lint --keyboard ${KB}
  39. fi
  40. done
  41. exit $exit_code