fix(ci): Better safeguards for ZMK variant build check (#3277)

Add an early guard to bail during the board compat check to ensure we
don't error out for out-of-tree boards with no ZMK variant.
This commit is contained in:
Pete Johanson
2026-03-09 09:08:02 -06:00
committed by GitHub
parent 714bbe30b0
commit 8feeb52eaf

View File

@@ -149,13 +149,18 @@ jobs:
- name: Check if building a board without explicit ZMK compat
if: always()
working-directory: ${{ env.base_dir }}/zmk/app
working-directory: "${{ env.base_dir }}/${{ inputs.config_path }}"
run: |
if ! (grep "CONFIG_ZMK_BOARD_COMPAT=y" "${{ env.build_dir }}/zephyr/.config" > /dev/null)
then
original_board=$(echo "${{ matrix.board }}" | sed -e 's$/.*$$')
west boards --board-root module --board-root . --board "${original_board}" --format "{qualifiers}" | grep "zmk" > /dev/null
west_board=$(west boards --board-root ${{ env.base_dir }}/zmk/app/module --board-root ${{ env.base_dir }}/zmk/app --board "${original_board}")
if [ -z "$west_board" ]; then
echo "Not found the board listed with west boards. Skipping further checking."
exit 0
fi
west boards --board-root ${{ env.base_dir }}/zmk/app/module --board-root ${{ env.base_dir }}/zmk/app --board "${original_board}" --format "{qualifiers}" | grep "zmk" > /dev/null
if [ $? -ne 0 ]
then
echo "::warning file=build/zephyr/.config,title=Missing ZMK Compat::The selected board does not report explicit ZMK compat. Please verify you've selected the correct board and ZMK variant if one exists"