Skip to content

Commit 1fa614c

Browse files
mergify[bot]meetgandhi-devpablogs9
authored
Remove non-header files from include folder (backport #716) (#754)
* 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 <meet.gandhi@einfochips.com> Co-authored-by: Meet Gandhi <meet.gandhi@fortrobotics.com> (cherry picked from commit 096ded0) * Fix CI Signed-off-by: Pablo Garrido <pablogs9@gmail.com> * Fix naming * Ensure naming * New line fix --------- Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Co-authored-by: Meet Gandhi <meet.gandhi@einfochips.com> Co-authored-by: Pablo Garrido <pablogs9@gmail.com>
1 parent fdccd24 commit 1fa614c

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,16 @@ jobs:
4444
run: |
4545
(test -f install/micro_ros_setup/lib/micro_ros_setup/build_firmware.sh) && true || false
4646
47+
- name: Sanitize Artifact Name
48+
id: sanitize-name
49+
run: |
50+
sanitized_name=$(echo "${{ inputs.ci_target_ref }}" | sed 's/[\/:*?"<>|\\]/_/g')
51+
echo "sanitized_name=$sanitized_name" >> $GITHUB_ENV
52+
echo "::set-output name=sanitized_name::$sanitized_name"
53+
4754
- uses: actions/upload-artifact@v4.4.0
4855
with:
49-
name: micro_ros_build_${{ inputs.ci_target_ref }}
56+
name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }}
5057
path: install
5158

5259
micro_ros_agent:
@@ -75,9 +82,16 @@ jobs:
7582
rosdep update --rosdistro ${{ env.ROS_DISTRO }}
7683
rosdep install --rosdistro ${{ env.ROS_DISTRO }} -y --from-paths src --ignore-src -y
7784
85+
- name: Sanitize Artifact Name
86+
id: sanitize-name
87+
run: |
88+
sanitized_name=$(echo "${{ inputs.ci_target_ref }}" | sed 's/[\/:*?"<>|\\]/_/g')
89+
echo "sanitized_name=$sanitized_name" >> $GITHUB_ENV
90+
echo "::set-output name=sanitized_name::$sanitized_name"
91+
7892
- uses: actions/download-artifact@v4.1.7
7993
with:
80-
name: micro_ros_build_${{ inputs.ci_target_ref }}
94+
name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }}
8195
path: install
8296

8397
# Workaround https://github.com/actions/upload-artifact/issues/38
@@ -218,9 +232,16 @@ jobs:
218232
rosdep update --rosdistro ${{ env.ROS_DISTRO }}
219233
rosdep install --rosdistro ${{ env.ROS_DISTRO }} -y --from-paths src --ignore-src -y
220234
235+
- name: Sanitize Artifact Name
236+
id: sanitize-name
237+
run: |
238+
sanitized_name=$(echo "${{ inputs.ci_target_ref }}" | sed 's/[\/:*?"<>|\\]/_/g')
239+
echo "sanitized_name=$sanitized_name" >> $GITHUB_ENV
240+
echo "::set-output name=sanitized_name::$sanitized_name"
241+
221242
- uses: actions/download-artifact@v4.1.7
222243
with:
223-
name: micro_ros_build_${{ inputs.ci_target_ref }}
244+
name: micro_ros_build_${{ steps.sanitize-name.outputs.sanitized_name }}
224245
path: install
225246

226247
# Workaround https://github.com/actions/upload-artifact/issues/38

config/generate_lib/generic/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ pushd $FW_TARGETDIR/mcu_ws >/dev/null
4848
done ; \
4949
ar rc libmicroros.a $(ls *.o *.obj 2> /dev/null); mkdir -p $BUILD_DIR; cp libmicroros.a $BUILD_DIR; ranlib $BUILD_DIR/libmicroros.a; \
5050
cp -R $FW_TARGETDIR/mcu_ws/install/include $BUILD_DIR/; \
51+
rm $(find $BUILD_DIR/include -type f -not -name "*.h" -not -name "*.hpp"); \
52+
rm -rf $(find $BUILD_DIR/include -type d -empty); \
5153
cd ..; rm -rf libmicroros;
5254

5355
popd >/dev/null

0 commit comments

Comments
 (0)