Skip to content

Commit

Permalink
Merge pull request #28 from vortexntnu/feat/add-support-for-external-…
Browse files Browse the repository at this point in the history
…dependency-installation-script-in-reusable-source-build-pipeline

feat(ci): add support for external dependency script in source build pipeline
  • Loading branch information
VegraD authored Nov 15, 2024
2 parents e1048ba + 6617dbe commit bbfdae7
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/reusable-source-build.yaml
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:
Expand Down Expand Up @@ -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 }}
Expand All @@ -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:
Expand Down

0 comments on commit bbfdae7

Please sign in to comment.