2020-06-21 03:19:56 +06:00
|
|
|
name: PR Lint keyboards
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'keyboards/**'
|
|
|
|
|
|
|
|
jobs:
|
2020-11-07 23:56:08 +06:00
|
|
|
lint:
|
2020-06-21 03:19:56 +06:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
container: qmkfm/base_container
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2020-09-05 19:37:25 +06:00
|
|
|
- uses: trilom/file-changes-action@v1.2.4
|
2020-08-17 15:12:45 +06:00
|
|
|
id: file_changes
|
|
|
|
with:
|
|
|
|
output: '\n'
|
|
|
|
|
2020-06-21 03:19:56 +06:00
|
|
|
- name: Print info
|
|
|
|
run: |
|
|
|
|
git rev-parse --short HEAD
|
|
|
|
echo ${{ github.event.pull_request.base.sha }}
|
2020-08-17 15:12:45 +06:00
|
|
|
echo '${{ steps.file_changes.outputs.files}}'
|
2020-06-21 03:19:56 +06:00
|
|
|
|
2020-11-07 23:56:08 +06:00
|
|
|
- name: Run qmk lint
|
2020-06-21 03:19:56 +06:00
|
|
|
shell: 'bash {0}'
|
|
|
|
run: |
|
2020-08-17 15:12:45 +06:00
|
|
|
QMK_CHANGES=$(echo -e '${{ steps.file_changes.outputs.files}}')
|
2020-06-21 03:19:56 +06:00
|
|
|
QMK_KEYBOARDS=$(qmk list-keyboards)
|
|
|
|
|
|
|
|
exit_code=0
|
|
|
|
for KB in $QMK_KEYBOARDS; do
|
|
|
|
KEYBOARD_CHANGES=$(echo "$QMK_CHANGES" | grep -E '^(keyboards/'${KB}'/)')
|
|
|
|
if [[ -z "$KEYBOARD_CHANGES" ]]; then
|
|
|
|
# skip as no changes for this keyboard
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
KEYMAP_ONLY=$(echo "$KEYBOARD_CHANGES" | grep -cv /keymaps/)
|
|
|
|
if [[ $KEYMAP_ONLY -gt 0 ]]; then
|
|
|
|
echo "linting ${KB}"
|
|
|
|
|
2020-11-07 23:56:08 +06:00
|
|
|
qmk lint --keyboard ${KB}
|
2020-06-21 03:19:56 +06:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
exit $exit_code
|