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

Delete iCub directory of icub-models every time the models are re-generated #236

Merged
merged 4 commits into from
Sep 15, 2023
Merged
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
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,26 @@ jobs:
ctest --output-on-failure
# Clone icub-models repo
git clone -b $ICUB_MODELS_BRANCH https://github.com/${DEPLOYMENT_REPOSITORY}.git ${ICUB_MODELS_SOURCE_DIR}
# Delete files in iCub directory of icub-models, as they are the one meant to be generated automatically every time
# See https://github.com/robotology/icub-models/issues/185
cd ${ICUB_MODELS_SOURCE_DIR}
git rm -rf ./iCub
# Generate new files
cd ${GITHUB_WORKSPACE}/build
cmake --build . --target copy-models-to-icub-models
# Generate commit message
echo "Automatic build. GitHub Actions build: $GITHUB_RUN_ID" >> ${GITHUB_WORKSPACE}/deploy_commit_message
echo "icub-model-generator commit: robotology/icub-models-generator@$GITHUB_SHA" >> ${GITHUB_WORKSPACE}/deploy_commit_message
echo "urdf_parser_py commit: ros/urdf_parser_py@$URDF_PARSER_PY_COMMIT" >> ${GITHUB_WORKSPACE}/deploy_commit_message
echo "simmechanics-to-urdf commit: robotology/simmechanics-to-urdf@$SIMMECHANICS_TO_URDF_COMMIT" >> ${GITHUB_WORKSPACE}/deploy_commit_message

- name: Print generated models differences
- name: Print generated models differences and add files
run: |
cd $ICUB_MODELS_SOURCE_DIR
git diff
# Add any new generated file
git add --all
git status

- name: Commit models
if: ${{ (github.event_name == 'push' && github.ref == env.TRIGGERING_BRANCH_VALID_FOR_DEPLOYMENT) || (github.event_name == 'workflow_dispatch' && github.event.inputs.push == 'true') }}
Expand All @@ -139,8 +148,6 @@ jobs:
echo "Commit committer is $GIT_COMMITTER_NAME (email: $GIT_COMMITTER_EMAIL)"
echo "Commit author is $GIT_AUTHOR_NAME (email: $GIT_AUTHOR_EMAIL)"
cd $ICUB_MODELS_SOURCE_DIR
# Add any new generated file
git add --all
# See https://stackoverflow.com/a/32507305
git commit -a -F ${GITHUB_WORKSPACE}/deploy_commit_message || echo "No changes in the icub-models branch, so no commit was done."

Expand Down