From 15a47a1fc9e22844c0fab90dd27ce8c60de7e19f Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Sat, 25 Nov 2023 16:00:31 +0000 Subject: [PATCH] fix(build): Use module load approach if found. * If we detect we're building a Zephyr module, use the module define to add it to the build instead of ZMK_CONFIG. --- .github/workflows/build-user-config.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-user-config.yml b/.github/workflows/build-user-config.yml index a0338230f514..6428e2da3bdc 100644 --- a/.github/workflows/build-user-config.yml +++ b/.github/workflows/build-user-config.yml @@ -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 @@ -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: |