-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from vortexntnu/feat/add-support-for-external-…
…dependency-installation-script-in-reusable-source-build-pipeline feat(ci): add support for external dependency script in source build pipeline
- Loading branch information
Showing
1 changed file
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
name: Reusable Source Build | ||
# Reusable GitHub Actions workflow to build all ROS 2 packages from source | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
|
@@ -32,8 +31,13 @@ on: | |
gcc_version: | ||
description: "GCC version to install" | ||
required: false | ||
default: "11" | ||
default: "11" # Default GCC version commonly available on Ubuntu 22.04 | ||
type: string | ||
download_requirements: | ||
description: "Download and execute requirements.sh if available" | ||
required: false | ||
default: false | ||
type: boolean | ||
jobs: | ||
build: | ||
runs-on: ${{ inputs.os_name }} | ||
|
@@ -50,6 +54,23 @@ jobs: | |
uses: ros-tooling/[email protected] | ||
with: | ||
required-ros-distributions: ${{ inputs.ros_distro }} | ||
# Check out the repository to get access to requirements.sh if required | ||
- name: Check out the repository | ||
if: inputs.download_requirements | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
# Conditionally download and execute requirements.sh if download_requirements is true and file exists | ||
- name: Download and install extra dependencies if requirements.sh exists | ||
if: inputs.download_requirements | ||
run: | | ||
if [ -f requirements.sh ]; then | ||
echo "Executing requirements.sh from repository root directory" | ||
chmod +x requirements.sh | ||
./requirements.sh | ||
else | ||
echo "requirements.sh file not found in repository root" | ||
fi | ||
- name: build and test ROS 2 packages | ||
uses: ros-tooling/[email protected] | ||
with: | ||
|