From c66c5a20c697cddeb8ead6d11dc5597d1c219531 Mon Sep 17 00:00:00 2001 From: Meet Gandhi Date: Mon, 9 Dec 2024 12:21:43 +0530 Subject: [PATCH 1/5] Remove non-header files from include folder (#716) The `include` directory previously contained all files copied over, but only `*.h` and `*.hpp` files are required. This commit removes all files that do not have a `.h` or `.hpp` extension, as well as any empty directories that may result from this cleanup. Signed-off-by: Meet Gandhi Co-authored-by: Meet Gandhi (cherry picked from commit 096ded099b8b11680991fac804af3e808b606d7d) --- config/generate_lib/generic/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/generate_lib/generic/build.sh b/config/generate_lib/generic/build.sh index 49af523b..006dd31a 100755 --- a/config/generate_lib/generic/build.sh +++ b/config/generate_lib/generic/build.sh @@ -48,6 +48,8 @@ pushd $FW_TARGETDIR/mcu_ws >/dev/null done ; \ ar rc libmicroros.a $(ls *.o *.obj 2> /dev/null); mkdir -p $BUILD_DIR; cp libmicroros.a $BUILD_DIR; ranlib $BUILD_DIR/libmicroros.a; \ cp -R $FW_TARGETDIR/mcu_ws/install/include $BUILD_DIR/; \ + rm $(find $BUILD_DIR/include -type f -not -name "*.h" -not -name "*.hpp") \ + rm -rf $(find $BUILD_DIR/include -type d -empty) \ cd ..; rm -rf libmicroros; popd >/dev/null From ec1bb1e14e05dd270136885389dfd2ee9b168578 Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Mon, 9 Dec 2024 08:00:31 +0100 Subject: [PATCH 2/5] Fix CI Signed-off-by: Pablo Garrido --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 263a7539..8d2a3af9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,9 +44,15 @@ jobs: run: | (test -f install/micro_ros_setup/lib/micro_ros_setup/build_firmware.sh) && true || false + - name: Sanitize Artifact Name + id: sanitize-name + run: | + sanitized_name=$(echo "${{ inputs.ci_target_ref }}" | sed 's/[\/:*?"<>|\\]/_/g') + echo "sanitized_name=$sanitized_name" >> $GITHUB_ENV + - uses: actions/upload-artifact@v4.4.0 with: - name: micro_ros_build_${{ inputs.ci_target_ref }} + name: micro_ros_build_${{ env.sanitized_name }} path: install micro_ros_agent: From 175041bdab0cc89cce2eb45dcd173d590569282f Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Mon, 9 Dec 2024 08:10:06 +0100 Subject: [PATCH 3/5] Fix naming --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d2a3af9..48612f2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,10 +49,11 @@ jobs: run: | sanitized_name=$(echo "${{ inputs.ci_target_ref }}" | sed 's/[\/:*?"<>|\\]/_/g') echo "sanitized_name=$sanitized_name" >> $GITHUB_ENV + echo "::set-output name=sanitized_name::$sanitized_name" - uses: actions/upload-artifact@v4.4.0 with: - name: micro_ros_build_${{ env.sanitized_name }} + name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }} path: install micro_ros_agent: @@ -83,7 +84,7 @@ jobs: - uses: actions/download-artifact@v4.1.7 with: - name: micro_ros_build_${{ inputs.ci_target_ref }} + name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }} path: install # Workaround https://github.com/actions/upload-artifact/issues/38 @@ -225,7 +226,7 @@ jobs: - uses: actions/download-artifact@v4.1.7 with: - name: micro_ros_build_${{ inputs.ci_target_ref }} + name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }} path: install # Workaround https://github.com/actions/upload-artifact/issues/38 From 6d19ac6e38ac86c551275de2e942c3009fbf370b Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Mon, 9 Dec 2024 08:19:05 +0100 Subject: [PATCH 4/5] Ensure naming --- .github/workflows/ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48612f2f..da1e6665 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,6 +82,13 @@ jobs: rosdep update --rosdistro ${{ env.ROS_DISTRO }} rosdep install --rosdistro ${{ env.ROS_DISTRO }} -y --from-paths src --ignore-src -y + - name: Sanitize Artifact Name + id: sanitize-name + run: | + sanitized_name=$(echo "${{ inputs.ci_target_ref }}" | sed 's/[\/:*?"<>|\\]/_/g') + echo "sanitized_name=$sanitized_name" >> $GITHUB_ENV + echo "::set-output name=sanitized_name::$sanitized_name" + - uses: actions/download-artifact@v4.1.7 with: name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }} @@ -224,6 +231,13 @@ jobs: rosdep update --rosdistro ${{ env.ROS_DISTRO }} rosdep install --rosdistro ${{ env.ROS_DISTRO }} -y --from-paths src --ignore-src -y + - name: Sanitize Artifact Name + id: sanitize-name + run: | + sanitized_name=$(echo "${{ inputs.ci_target_ref }}" | sed 's/[\/:*?"<>|\\]/_/g') + echo "sanitized_name=$sanitized_name" >> $GITHUB_ENV + echo "::set-output name=sanitized_name::$sanitized_name" + - uses: actions/download-artifact@v4.1.7 with: name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }} From 14272994c3c754347f708f21d08003f48550364b Mon Sep 17 00:00:00 2001 From: Pablo Garrido Date: Mon, 9 Dec 2024 08:58:22 +0100 Subject: [PATCH 5/5] New line fix --- config/generate_lib/generic/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/generate_lib/generic/build.sh b/config/generate_lib/generic/build.sh index 006dd31a..891676b6 100755 --- a/config/generate_lib/generic/build.sh +++ b/config/generate_lib/generic/build.sh @@ -48,8 +48,8 @@ pushd $FW_TARGETDIR/mcu_ws >/dev/null done ; \ ar rc libmicroros.a $(ls *.o *.obj 2> /dev/null); mkdir -p $BUILD_DIR; cp libmicroros.a $BUILD_DIR; ranlib $BUILD_DIR/libmicroros.a; \ cp -R $FW_TARGETDIR/mcu_ws/install/include $BUILD_DIR/; \ - rm $(find $BUILD_DIR/include -type f -not -name "*.h" -not -name "*.hpp") \ - rm -rf $(find $BUILD_DIR/include -type d -empty) \ + rm $(find $BUILD_DIR/include -type f -not -name "*.h" -not -name "*.hpp"); \ + rm -rf $(find $BUILD_DIR/include -type d -empty); \ cd ..; rm -rf libmicroros; popd >/dev/null