Skip to content

Commit

Permalink
fix(build): Use module load approach if found.
Browse files Browse the repository at this point in the history
* If we detect we're building a Zephyr module, use the module
  define to add it to the build instead of ZMK_CONFIG.
  • Loading branch information
petejohanson committed Nov 25, 2023
1 parent 3eff3df commit 15a47a1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/build-user-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,15 @@ jobs:
shield: ${{ matrix.shield }}
artifact_name: ${{ matrix.artifact-name }}
run: |
ls zephyr/
if [ -e zephyr/module.yml ]; then export zmk_extra_modules_arg=" -DZMK_EXTRA_MODULES='$(pwd)'"; fi
if [ -e zephyr/module.yml ]; then
export zmk_load_arg="-DZMK_EXTRA_MODULES='${GITHUB_WORKSPACE}'"
else
export zmk_load_arg="-DZMK_CONFIG='${GITHUB_WORKSPACE}/${{ inputs.config_path }}'"
fi
echo "load_arg=${zmk_load_arg}" >> $GITHUB_ENV
echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV
echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}${zmk_extra_modules_arg}" >> $GITHUB_ENV
echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}" >> $GITHUB_ENV
echo "display_name=${shield:+$shield - }${board}" >> $GITHUB_ENV
echo "artifact_name=${artifact_name:-${shield:+$shield-}${board}-zmk}" >> $GITHUB_ENV
Expand Down Expand Up @@ -102,7 +107,7 @@ jobs:

- name: West Build (${{ env.display_name }})
shell: sh -x {0}
run: west build -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/${{ inputs.config_path }}" ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}
run: west build -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" -- ${{ env.load_arg }} ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}

- name: ${{ env.display_name }} Kconfig file
run: |
Expand Down

0 comments on commit 15a47a1

Please sign in to comment.