Skip to content

Commit

Permalink
Update fastdds-build workflow to manually set dependencies version (#35)
Browse files Browse the repository at this point in the history
* Update fastdds-build workflow to manually set dependencies version

Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com>

* Keep fetch dependencies from .repos option

Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com>

* Do not scape " in inputs comments

Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com>

* Update README and actions description

Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com>

* Update actions branch to main

Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com>

---------

Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com>
  • Loading branch information
rsanchez15 authored Oct 24, 2023
1 parent a76eda7 commit d7cdcfb
Show file tree
Hide file tree
Showing 5 changed files with 227 additions and 9 deletions.
88 changes: 79 additions & 9 deletions .github/workflows/build_fastdds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,22 @@
# MANUAL RUN:
# Running this workflow manually, the following arguments might be set:
#
# built_configuration_branch: set a branch to download dependencies.repos and colcon.meta files from
# this repository [Default: main]
# built_configuration_branch: set a branch to download colcon.meta file from this repository [Default: main]
#
# artifacts_name_postfix: set the postfix name for the uploading artifact [Default: _manual]
# Note: do not use "_nightly" in this argument, or other workflows may be affected
# artifacts_name_postfix: set the postfix name for the uploading artifact [Default: _manual]
# Note: do not use "_nightly" in this argument, or other workflows may be affected
#
# use_repos_file: flag to use .repos file instead of manually set repository branches.
# The .repos file will be downloaded from the eProsima-CI branch set in "built_configuration_branch".
#
# foonathan_memory_vendor_branch: branch, tag or commit of eProsima/foonathan_memory_vendor repository.
# Check available branches in https://github.com/eProsima/foonathan_memory_vendor.
#
# fastcdr_branch: branch, tag or commit of eProsima/Fast-CDR repository.
# Check available branches in https://github.com/eProsima/Fast-CDR.
#
# fastdds_branch: branch, tag or commit of eProsima/Fast-DDS repository.
# Check available branches in https://github.com/eProsima/Fast-DDS.
#

name: build_fastdds
Expand All @@ -37,15 +48,49 @@ on:
inputs:

built_configuration_branch:
description: Branch or tag of eProsima-CI repository to get .repos and colcon.meta that will be applied
description: >
Branch or tag of eProsima-CI repository to get colcon.meta (and .repos if "use_repos_file" input set to
true) that will be applied.
required: false
default: main

use_repos_file:
description: >
Flag to use .repos file instead of manually set repository branches.
The .repos file will be downloaded from the eProsima-CI branch set in "built_configuration_branch".
required: false
type: boolean
default: true

artifacts_name_postfix:
description: Addition to artifacts name creation (do not use _nightly postfix when creating artifacts with specific arguments).
description: >
Addition to artifacts name creation (do not use _nightly postfix when creating artifacts with specific
arguments).
required: false
default: _manual

foonathan_memory_vendor_branch:
description: >
Branch, tag or commit of eProsima/foonathan_memory_vendor repository.
Check available branches in https://github.com/eProsima/foonathan_memory_vendor.
required: false
default: master

fastcdr_branch:
description: >
Branch, tag or commit of eProsima/Fast-CDR repository.
Check available branches in https://github.com/eProsima/Fast-CDR.
required: false
default: master

fastdds_branch:
description: >
Branch, tag or commit of eProsima/Fast-DDS repository.
Check available branches in https://github.com/eProsima/Fast-DDS.
required: false
default: master

schedule:

# Every night at 00:00
Expand All @@ -55,6 +100,10 @@ env:
default_configuration_branch: main
default_artifact_postfix: _nightly
artifact_prefix: built_fastdds
default_foonathan_memory_vendor_branch: master
default_fastcdr_branch: master
default_fastdds_branch: master


jobs:

Expand Down Expand Up @@ -98,10 +147,31 @@ jobs:
colcon_meta_file_result: ${{ github.workspace }}/colcon.meta
repos_file_result: ${{ github.workspace }}/dependencies.repos

- name: Build Fast DDS and generate artifact
uses: eProsima/eProsima-CI/multiplatform/generate_dependency_artifact@main
- name: Fetch Fast DDS repositories with vcs-tool
uses: eProsima/eProsima-CI/multiplatform/vcs_import@main
if: inputs.use_repos_file
with:
vcs_repos_file: ${{ github.workspace }}/dependencies.repos
artifact_name: ${{ env.artifact_prefix }}_${{ matrix.os }}_${{ matrix.cmake_build_type }}${{ inputs.artifacts_name_postfix || env.default_artifact_postfix }}
destination_workspace: ${{ github.workspace }}/artifact/src

- name: Fetch Fast DDS repositories
uses: eProsima/eProsima-CI/multiplatform/fetch_fastdds_manual@main
if: (!inputs.use_repos_file)
with:
foonathan_memory_vendor_branch: ${{ inputs.foonathan_memory_vendor_branch || env.default_foonathan_memory_vendor_branch }}
fastcdr_branch: ${{ inputs.fastcdr_branch || env.default_fastcdr_branch }}
fastdds_branch: ${{ inputs.fastdds_branch || env.default_fastdds_branch }}
destination_workspace: ${{ github.workspace }}/artifact/src

- name: Build workspace
uses: eProsima/eProsima-CI/multiplatform/colcon_build@main
with:
colcon_meta_file: ${{ github.workspace }}/colcon.meta
workspace: ${{ github.workspace }}/artifact
cmake_build_type: ${{ matrix.cmake_build_type }}

- name: Upload binaries
uses: eProsima/eProsima-CI/external/upload-artifact@main
with:
name: ${{ env.artifact_prefix }}_${{ matrix.os }}_${{ matrix.cmake_build_type }}${{ inputs.artifacts_name_postfix || env.default_artifact_postfix }}
path: ${{ github.workspace }}/artifact/install
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ For more information about versioning handle of this project, check following [f
- [download_dependency](multiplatform/download_dependency/action.yml)
- Download an artifact previously generated from a workflow run.

- [fetch_fastdds_manual](multiplatform/fetch_fastdds_manual/action.yml)
- Download Fast DDS and its eProsima dependencies setting the specific version of each repository.

- [generate_dependency_artifact](multiplatform/generate_dependency_artifact/action.yml)
- Build a project and upload the installed objects as an artifact.

Expand Down Expand Up @@ -210,6 +213,9 @@ Run the `manual_build` workflow with these arguments:

> :warning: Do not generate custom artifacts with postfix `_nightly`, as this is the main name other repos will use.

> :page_facing_up: Fast DDS manual build allows to specify Fast DDS and its eProsima dependencies version as inputs of the workflow.
In order to use the manually set versions instead of the ones taken from the `.repos` file, just disable `use_repos_file` option.

## Custom artifact generation

The workflow [manual_build](.github/workflows/manual_build.yml) supports to create any artifact giving a `.repos` and `colcon.meta` files.
Expand Down
46 changes: 46 additions & 0 deletions multiplatform/fetch_fastdds_manual/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: fetch_fastdds_manual
description: Download Fast DDS and its eProsima dependencies setting the specific version of each repository

inputs:

foonathan_memory_vendor_branch:
description: Branch, tag or commit of eProsima/foonathan_memory_vendor repository. Check available branches in https://github.com/eProsima/foonathan_memory_vendor.
required: false
default: master

fastcdr_branch:
description: Branch, tag or commit of eProsima/Fast-CDR repository. Check available branches in https://github.com/eProsima/Fast-CDR.
required: false
default: master

fastdds_branch:
description: Branch, tag or commit of eProsima/Fast-DDS repository. Check available branches in https://github.com/eProsima/Fast-DDS.
required: false
default: master

destination_workspace:
description: 'Workspace where the repositories are downloaded'
required: false
default: '${{ github.workspace }}'

runs:
using: composite
steps:

- name: Run in ubuntu
uses: eProsima/eProsima-CI/ubuntu/fetch_fastdds_manual@main
if: runner.os == 'Linux'
with:
foonathan_memory_vendor_branch: ${{ inputs.foonathan_memory_vendor_branch }}
fastcdr_branch: ${{ inputs.fastcdr_branch }}
fastdds_branch: ${{ inputs.fastdds_branch }}
destination_workspace: ${{ inputs.destination_workspace }}

- name: Run in windows
uses: eProsima/eProsima-CI/windows/fetch_fastdds_manual@main
if: runner.os == 'Windows'
with:
foonathan_memory_vendor_branch: ${{ inputs.foonathan_memory_vendor_branch }}
fastcdr_branch: ${{ inputs.fastcdr_branch }}
fastdds_branch: ${{ inputs.fastdds_branch }}
destination_workspace: ${{ inputs.destination_workspace }}
48 changes: 48 additions & 0 deletions ubuntu/fetch_fastdds_manual/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: fetch_fastdds_manual
description: Download Fast DDS and its eProsima dependencies setting the specific version of each repository

inputs:

foonathan_memory_vendor_branch:
description: Branch, tag or commit of eProsima/foonathan_memory_vendor repository. Check available branches in https://github.com/eProsima/foonathan_memory_vendor.
required: false
default: master

fastcdr_branch:
description: Branch, tag or commit of eProsima/Fast-CDR repository. Check available branches in https://github.com/eProsima/Fast-CDR.
required: false
default: master

fastdds_branch:
description: Branch, tag or commit of eProsima/Fast-DDS repository. Check available branches in https://github.com/eProsima/Fast-DDS.
required: false
default: master

destination_workspace:
description: 'Workspace where the repositories are downloaded'
required: false
default: '${{ github.workspace }}'

runs:
using: composite
steps:

- name: fetch_fastdds_manual
run: |
echo "::group::Manually clone Fast DDS repositories"
echo "Downloading following dependencies:"
echo " - Foonathan Memory Vendor: ${{ inputs.foonathan_memory_vendor_branch }}"
echo " - Fast CDR: ${{ inputs.fastcdr_branch }}"
echo " - Fast DDS: ${{ inputs.fastdds_branch }}"
mkdir -p ${{ inputs.destination_workspace }}
cd ${{ inputs.destination_workspace }}
git clone --branch ${{ inputs.foonathan_memory_vendor_branch }} https://github.com/eProsima/foonathan_memory_vendor.git
git clone --branch ${{ inputs.fastcdr_branch }} https://github.com/eProsima/Fast-CDR.git
git clone --branch ${{ inputs.fastdds_branch }} https://github.com/eProsima/Fast-DDS.git
echo "::endgroup::"
shell: bash
48 changes: 48 additions & 0 deletions windows/fetch_fastdds_manual/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: fetch_fastdds_manual
description: Download Fast DDS and its eProsima dependencies setting the specific version of each repository

inputs:

foonathan_memory_vendor_branch:
description: Branch, tag or commit of eProsima/foonathan_memory_vendor repository. Check available branches in https://github.com/eProsima/foonathan_memory_vendor.
required: false
default: master

fastcdr_branch:
description: Branch, tag or commit of eProsima/Fast-CDR repository. Check available branches in https://github.com/eProsima/Fast-CDR.
required: false
default: master

fastdds_branch:
description: Branch, tag or commit of eProsima/Fast-DDS repository. Check available branches in https://github.com/eProsima/Fast-DDS.
required: false
default: master

destination_workspace:
description: 'Workspace where the repositories are downloaded'
required: false
default: '${{ github.workspace }}'

runs:
using: composite
steps:

- name: fetch_fastdds_manual
shell: pwsh
run: |
"::group::Manually clone Fast DDS repositories"
Write-Host 'Downloading following dependencies:'
Write-Host ' - Foonathan Memory Vendor: ${{ inputs.foonathan_memory_vendor_branch }}'
Write-Host ' - Fast CDR: ${{ inputs.fastcdr_branch }}'
Write-Host ' - Fast DDS: ${{ inputs.fastdds_branch }}'
New-Item -ItemType Directory -Force -Path ${{ inputs.destination_workspace }}
Set-Location -Path ${{ inputs.destination_workspace }}
git clone --branch ${{ inputs.foonathan_memory_vendor_branch }} https://github.com/eProsima/foonathan_memory_vendor.git
git clone --branch ${{ inputs.fastcdr_branch }} https://github.com/eProsima/Fast-CDR.git
git clone --branch ${{ inputs.fastdds_branch }} https://github.com/eProsima/Fast-DDS.git
"::endgroup::"

0 comments on commit d7cdcfb

Please sign in to comment.