Skip to content

Commit

Permalink
fix(build): Move config files to a tmp workspace.
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Nov 25, 2023
1 parent 4cfc148 commit 202012f
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/build-user-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,32 @@ jobs:
shield: ${{ matrix.shield }}
artifact_name: ${{ matrix.artifact-name }}
run: |
echo "tmp_dir=$(mktemp -d)" >> $GITHUB_ENV
echo "tmp_config_dir=${{ env.tmp_dir }}/config/" >> $GITHUB_ENV
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 }}'"
export zmk_load_arg=" -DZMK_EXTRA_MODULES='${GITHUB_WORKSPACE}'"
fi
echo "load_arg=${zmk_load_arg}" >> $GITHUB_ENV
echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV
echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}" >> $GITHUB_ENV
echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}${zmk_load_arg}" >> $GITHUB_ENV
echo "display_name=${shield:+$shield - }${board}" >> $GITHUB_ENV
echo "artifact_name=${artifact_name:-${shield:+$shield-}${board}-zmk}" >> $GITHUB_ENV
- name: Move config files to isolate temporary directory
run: mv ${{ input.config_path }}/* "${{ env.tmp_config_dir }}/""
- name: Cache west modules
uses: actions/[email protected]
continue-on-error: true
env:
cache_name: cache-zephyr-${{ env.zephyr_version }}-modules
with:
path: |
modules/
tools/
zephyr/
bootloader/
zmk/
${{ env.tmp_dir }}/modules/
${{ env.tmp_dir }}/tools/
${{ env.tmp_dir }}/zephyr/
${{ env.tmp_dir }}/bootloader/
${{ env.tmp_dir }}/zmk/
key: ${{ runner.os }}-build-${{ env.cache_name }}-${{ hashFiles('**/west.yml', '**/build.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache_name }}-
Expand All @@ -107,7 +109,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 }}" -- ${{ env.load_arg }} ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}
run: west build -s ${{ env.tmp_dir }}/zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" -- -DZMK_CONFIG=${{ env.tmp_config_dir }} ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}

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

0 comments on commit 202012f

Please sign in to comment.