aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows
diff options
context:
space:
mode:
authorGravatar Joel Challis <git@zvecr.com>2020-06-20 22:19:56 +0100
committerGravatar GitHub <noreply@github.com>2020-06-20 22:19:56 +0100
commitb6e9ef8dd1f2d9e7f0ea82b60e823bf25f5164b6 (patch)
tree8cafc59d3fc9a7e88e38196d33848e8b76032707 /.github/workflows
parente58ab6d326f7d99e9b518ae3b3a9da5045104d63 (diff)
downloadqmk_firmware-b6e9ef8dd1f2d9e7f0ea82b60e823bf25f5164b6.tar.gz
CI: Run 'qmk info' on keyboard changes (#9212)
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/info.yml49
1 files changed, 49 insertions, 0 deletions
diff --git a/.github/workflows/info.yml b/.github/workflows/info.yml
new file mode 100644
index 000000000..31a110583
--- /dev/null
+++ b/.github/workflows/info.yml
@@ -0,0 +1,49 @@
+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
+
+ - name: Print info
+ run: |
+ git rev-parse --short HEAD
+ echo ${{ github.event.pull_request.base.sha }}
+ git diff --name-only ${{ github.event.pull_request.base.sha }}...
+
+ - name: Run qmk info
+ shell: 'bash {0}'
+ run: |
+ QMK_CHANGES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}...)
+ 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 -kb ${KB} 2>&1 | tee /tmp/$$
+ !(grep -cq ☒ /tmp/$$)
+ : $((exit_code = $exit_code + $?))
+ fi
+ done
+ exit $exit_code