Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(workflow): Update Zephyr-HAL workflow #1331

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions .github/workflows/scripts/zephyr-hal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ cd ${msdk}
msdk_head=$(git rev-parse HEAD)
cd ${root_dir}

# Store msdk_sha file if exist
if [ -e "${hal_adi}/MAX/msdk_sha" ]; then
mv ${hal_adi}/MAX/msdk_sha ${root_dir}
fi

# Cleanup hal_adi
rm -rf ${hal_adi}/MAX/
Expand All @@ -32,6 +36,11 @@ mkdir -p ${hal_adi}/MAX/Libraries/PeriphDrivers
# Copy zephyr wrappers, system files and cmakefiles
cp -rf ${msdk}/Libraries/zephyr/MAX/* ${hal_adi}/MAX/

# Move "msdk_sha" file again to not create a difference.
if [ -e "${root_dir}/msdk_sha" ]; then
mv ${root_dir}/msdk_sha ${hal_adi}/MAX
fi

# Copy CMSIS folder
cp -rf ${msdk}/Libraries/CMSIS/Device ${hal_adi}/MAX/Libraries/CMSIS/
cp -rf ${msdk}/Libraries/CMSIS/Include ${hal_adi}/MAX/Libraries/CMSIS/
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/zephyr-hal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,19 @@ jobs:

- name: Push changes to hal_adi repository
run: |
echo "$(pwd) - $(ls)"
echo -e "$(pwd)\n\n$(ls)\n"
cd ./hal_adi
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add *
git commit -m "Update Zephyr MSDK Hal based on MSDK PR: https://github.com/analogdevicesinc/msdk/pull/${PR_NUM}"
git push
if [[ -n $(git status -s) ]]; then
echo "Starting to commit changes to hal_adi repository"
cd ${msdk}
msdk_head=$(git rev-parse HEAD)
commit_author=$(git show --no-patch --format="%an <%ae>" ${msdk_head})
commit_msg=$(git show --no-patch --format="%B" ${msdk_head})

cd ${hal_adi}
git add *
git commit --author="${commit_author}" -m "${commit_msg}"
git push
else
echo "No changes to commit"
fi
Loading