Skip to content

Commit

Permalink
Delete iCub directory of icub-models every time the models are re-gen…
Browse files Browse the repository at this point in the history
…erated (#236)
  • Loading branch information
traversaro authored Sep 15, 2023
1 parent 98d0ff6 commit c0fe4a0
Showing 1 changed file with 10 additions and 3 deletions.
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

0 comments on commit c0fe4a0

Please sign in to comment.