aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-06-20 22:19:56 +0100
committerGitHub <noreply@github.com>2020-06-20 22:19:56 +0100
commitb6e9ef8dd1f2d9e7f0ea82b60e823bf25f5164b6 (patch)
tree8cafc59d3fc9a7e88e38196d33848e8b76032707
parente58ab6d326f7d99e9b518ae3b3a9da5045104d63 (diff)
downloadqmk_firmware-b6e9ef8dd1f2d9e7f0ea82b60e823bf25f5164b6.tar.gz
qmk_firmware-b6e9ef8dd1f2d9e7f0ea82b60e823bf25f5164b6.zip
CI: Run 'qmk info' on keyboard changes (#9212)
-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 @@
1name: PR Lint keyboards
2
3on:
4 pull_request:
5 paths:
6 - 'keyboards/**'
7
8jobs:
9 info:
10 runs-on: ubuntu-latest
11
12 container: qmkfm/base_container
13
14 steps:
15 - uses: actions/checkout@v2
16 with:
17 fetch-depth: 0
18
19 - name: Print info
20 run: |
21 git rev-parse --short HEAD
22 echo ${{ github.event.pull_request.base.sha }}
23 git diff --name-only ${{ github.event.pull_request.base.sha }}...
24
25 - name: Run qmk info
26 shell: 'bash {0}'
27 run: |
28 QMK_CHANGES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}...)
29 QMK_KEYBOARDS=$(qmk list-keyboards)
30
31 exit_code=0
32 for KB in $QMK_KEYBOARDS; do
33 KEYBOARD_CHANGES=$(echo "$QMK_CHANGES" | grep -E '^(keyboards/'${KB}'/)')
34 if [[ -z "$KEYBOARD_CHANGES" ]]; then
35 # skip as no changes for this keyboard
36 continue
37 fi
38
39 KEYMAP_ONLY=$(echo "$KEYBOARD_CHANGES" | grep -cv /keymaps/)
40 if [[ $KEYMAP_ONLY -gt 0 ]]; then
41 echo "linting ${KB}"
42
43 # TODO: info info always returns 0 - right now the only way to know failure is to inspect log lines
44 qmk info -kb ${KB} 2>&1 | tee /tmp/$$
45 !(grep -cq ☒ /tmp/$$)
46 : $((exit_code = $exit_code + $?))
47 fi
48 done
49 exit $exit_code