Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions .github/workflows/build-user-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,24 @@ jobs:
export zmk_load_arg=" -DZMK_EXTRA_MODULES='${GITHUB_WORKSPACE}'"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect I may need to also change the zephyr/module.yml check to check the config parent directory.

new_tmp_dir="${TMPDIR:-/tmp}/zmk-config"
mkdir -p "${new_tmp_dir}"
echo "base_dir=${new_tmp_dir}" >> $GITHUB_ENV
base_dir="${new_tmp_dir}"
else
echo "base_dir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
base_dir=${GITHUB_WORKSPACE}
fi

if [ -n "${snippet}" ]; then
extra_west_args="-S \"${snippet}\""
fi

config_path_parent="$(dirname ${{ inputs.config_path }})"
if [ "${config_path_parent}" = "${base_dir}" ]; then
west_workspace_dir="${base_dir}"
else
west_workspace_dir="${base_dir}/${config_path_parent}"
fi

echo "base_dir=${base_dir}" >> $GITHUB_ENV
echo "west_workspace_dir=${west_workspace_dir}" >> $GITHUB_ENV
echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV
echo "extra_west_args=${extra_west_args}" >> $GITHUB_ENV
echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}${zmk_load_arg}" >> $GITHUB_ENV
Expand All @@ -97,11 +106,11 @@ jobs:
cache_name: cache-zephyr-${{ env.zephyr_version }}-modules
with:
path: |
${{ env.base_dir }}/modules/
${{ env.base_dir }}/tools/
${{ env.base_dir }}/zephyr/
${{ env.base_dir }}/bootloader/
${{ env.base_dir }}/zmk/
${{ env.west_workspace_dir }}/modules/
${{ env.west_workspace_dir }}/tools/
${{ env.west_workspace_dir }}/zephyr/
${{ env.west_workspace_dir }}/bootloader/
${{ env.west_workspace_dir }}/zmk/
key: ${{ runner.os }}-build-${{ env.cache_name }}-${{ hashFiles('**/west.yml', '**/build.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache_name }}-
Expand All @@ -113,15 +122,15 @@ jobs:
run: west init -l "${{ env.base_dir }}/${{ inputs.config_path }}"

- name: West Update
working-directory: ${{ env.base_dir }}
working-directory: ${{ env.west_workspace_dir }}
run: west update --fetch-opt=--filter=tree:0

- name: West Zephyr export
working-directory: ${{ env.base_dir }}
working-directory: ${{ env.west_workspace_dir }}
run: west zephyr-export

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

Expand Down