forked from forks/qmk_firmware
d02301e59d
* swap git diff logic to github action * Print out layouts when linting
55 lines
1.4 KiB
YAML
55 lines
1.4 KiB
YAML
name: PR Lint keyboards
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'keyboards/**'
|
|
|
|
jobs:
|
|
info:
|
|
runs-on: ubuntu-latest
|
|
|
|
container: qmkfm/base_container
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: trilom/file-changes-action@v1.2.3
|
|
id: file_changes
|
|
with:
|
|
output: '\n'
|
|
|
|
- name: Print info
|
|
run: |
|
|
git rev-parse --short HEAD
|
|
echo ${{ github.event.pull_request.base.sha }}
|
|
echo '${{ steps.file_changes.outputs.files}}'
|
|
|
|
- name: Run qmk info
|
|
shell: 'bash {0}'
|
|
run: |
|
|
QMK_CHANGES=$(echo -e '${{ steps.file_changes.outputs.files}}')
|
|
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}"
|
|
|
|
# TODO: info info always returns 0 - right now the only way to know failure is to inspect log lines
|
|
qmk info -l -kb ${KB} 2>&1 | tee /tmp/$$
|
|
!(grep -cq ☒ /tmp/$$)
|
|
: $((exit_code = $exit_code + $?))
|
|
fi
|
|
done
|
|
exit $exit_code
|