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

Add pre build hook #43

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ If set, this branch will be used to push the packages instead of `DEB_DISTRO-ROS

If set to true, Git Large File Storage will be used to store the generated binaries.

## ``PRE_BUILD_HOOK``

TODO
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update


## Example usage

```
Expand Down
4 changes: 4 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ inputs:
GIT_LFS:
description: If set to true, use Git Large File Storage for storing binaries (*.deb and *.ddeb)
required: false
PRE_BUILD_HOOK:
description: If set, this script will be executed before running sbuild.
required: false
runs:
using: composite
steps:
Expand All @@ -66,6 +69,7 @@ runs:
ROSDEP_SOURCE: ${{ inputs.ROSDEP_SOURCE }}
SKIP_ROS_REPOSITORY: ${{ inputs.SKIP_ROS_REPOSITORY }}
SKIP_PACKAGES: ${{ inputs.SKIP_PACKAGES }}
PRE_BUILD_HOOK: ${{ inputs.PRE_BUILD_HOOK }}
- name: Create apt repository and deploy it
run: $GITHUB_ACTION_PATH/repository
shell: sh
Expand Down
6 changes: 6 additions & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ echo "$ROSDEP_SOURCE" > "$APT_REPO/2-remote.list"

ROS_HOME="$APT_REPO/ros" ROSDEP_SOURCE_PATH="$APT_REPO:/etc/ros/rosdep/sources.list.d/" rosdep update


if [ -n "$PRE_BUILD_HOOK" ]; then
echo "Run pre-build hook"
eval "$PRE_BUILD_HOOK"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it is better to run a script here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same thought in mind, the user specifies a path to a script that get executed rather than a string. Do you want me to update it?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be great if you could do it.

fi

echo "Run sbuild"

# Don't build tests
Expand Down