build_fastdds #672
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
# This Workflow builds an artifact with Fast DDS installed. | |
# This is used by other workflows in this and other repositories to avoid compiling Fast DDS every time is needed. | |
# | |
# DESCRIPTION: | |
# This workflow takes a .repos file from "./.github/workflows/configurations/fastdds/dependencies.repos" (in this same repository) and downloads the repositories included. | |
# Then uses the colcon.meta files in "./.github/workflows/configurations/metas/<os>/colcon.meta" to the build projects. | |
# Finally it takes the install directory generated from colcon build and uploads it as an artifact. | |
# This is done for several OS and cmake built types: | |
# - ubuntu-22.04 | ubuntu-24.04 | windows-2019 | windows-2022 | |
# - Debug | Release | |
# | |
# ARTIFACT RESULT: | |
# The artifact generated is called "build_fastdds_<os>_<cmake_build_type><postfix>" | |
# - <os> is "ubuntu-22.04", "ubuntu-24.04", "windows-2019", or "windows-2022" | |
# - <cmake_build_type> is "Debug", or "Release" | |
# - <postfix> is "_nightly" for scheduled runs every night, or is set manually by the user. | |
# | |
# SCHEDULE: | |
# This workflow runs every night at 00:00 using latest version of Fast DDS (master). | |
# | |
# MANUAL RUN & WORKFLOW CALL: | |
# Running this workflow manually or from another workflow, the following arguments might be set: | |
# single_version_build: flag to build only the custom version taken from inputs or .repos file. | |
# If set to false, all versions of Fast DDS (v2 and v3) will be 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 | |
# | |
# 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 | |
on: | |
workflow_call: | |
inputs: | |
single_version_build: | |
description: > | |
Flag to build only the custom version taken from inputs. | |
If set to false, all versions of Fast DDS (v2 and v3) will be built. | |
required: true | |
type: boolean | |
default: true | |
configuration_branch: | |
description: > | |
Branch or tag of eProsima-CI repository to get colcon.meta that will be applied. | |
required: false | |
type: string | |
default: main | |
artifacts_name_postfix: | |
description: > | |
Addition to artifacts name creation (do not use _nightly postfix when creating artifacts with specific | |
arguments). | |
required: false | |
type: string | |
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 | |
type: string | |
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 | |
type: string | |
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 | |
type: string | |
default: master | |
workflow_dispatch: | |
inputs: | |
single_version_build: | |
description: > | |
Flag to build only the custom version taken from inputs. | |
If set to false, all versions of Fast DDS (v2 and v3) will be built. | |
required: true | |
type: boolean | |
default: true | |
configuration_branch: | |
description: > | |
Branch or tag of eProsima-CI repository to get colcon.meta that will be applied. | |
required: false | |
type: string | |
default: main | |
artifacts_name_postfix: | |
description: > | |
Addition to artifacts name creation (do not use _nightly postfix when creating artifacts with specific | |
arguments). | |
required: false | |
type: string | |
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 | |
type: string | |
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 | |
type: string | |
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 | |
type: string | |
default: master | |
schedule: | |
# Every night at 00:00 | |
- cron: '0 0 * * *' | |
env: | |
default_configuration_branch: main | |
default_artifact_postfix: _nightly | |
artifact_prefix: build_fastdds | |
default_foonathan_memory_vendor_branch: master | |
default_fastcdr_branch: master | |
default_fastdds_branch: master | |
jobs: | |
build_fastdds_single_version: | |
name: build_fastdds_manual | |
runs-on: ${{ matrix.os }} | |
if: ${{ contains(inputs.single_version_build, 'true') }} | |
strategy: | |
matrix: | |
cmake_build_type: | |
- Release | |
- Debug | |
os: | |
- ubuntu-22.04 | |
- ubuntu-24.04 | |
- windows-2019 | |
- windows-2022 | |
# Not cancel workflow if any matrix job fails | |
fail-fast: false | |
steps: | |
- name: Sync this repository | |
uses: eProsima/eProsima-CI/external/checkout@main | |
with: | |
path: src/eprosima-CI | |
- name: Install Fast DDS dependencies | |
uses: eProsima/eProsima-CI/multiplatform/install_fastdds_dependencies@main | |
with: | |
cmake_build_type: ${{ matrix.cmake_build_type }} | |
- name: Get colcon.meta file to build fastdds | |
uses: eProsima/eProsima-CI/multiplatform/get_configurations_from_repo@main | |
with: | |
source_repository_branch: ${{ inputs.configuration_branch || env.default_configuration_branch }} | |
colcon_meta_file_path: .github/workflows/configurations/metas/${{ matrix.os }}/colcon.meta | |
repos_file_path: .github/workflows/configurations/fastdds/dependencies.repos | |
colcon_meta_file_result: ${{ github.workspace }}/colcon.meta | |
repos_file_result: ${{ github.workspace }}/dependencies.repos | |
- name: Fetch Fast DDS repositories | |
uses: eProsima/eProsima-CI/multiplatform/fetch_fastdds_manual@main | |
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 }}_custom_${{ matrix.os }}_${{ matrix.cmake_build_type }}${{ inputs.artifacts_name_postfix || env.default_artifact_postfix }} | |
path: ${{ github.workspace }}/artifact/install | |
build_fastdds: | |
name: build_fastdds | |
runs-on: ${{ matrix.os }} | |
if: ${{ github.event_name == 'schedule' || contains(inputs.single_version_build, 'false') }} | |
strategy: | |
matrix: | |
fastdds_version: | |
- v2 | |
- v3 | |
cmake_build_type: | |
- Release | |
- Debug | |
os: | |
- ubuntu-22.04 | |
- ubuntu-24.04 | |
- windows-2019 | |
- windows-2022 | |
# Not cancel workflow if any matrix job fails | |
fail-fast: false | |
steps: | |
- name: Sync this repository | |
uses: eProsima/eProsima-CI/external/checkout@main | |
with: | |
path: src/eprosima-CI | |
- name: Install Fast DDS dependencies | |
uses: eProsima/eProsima-CI/multiplatform/install_fastdds_dependencies@main | |
with: | |
cmake_build_type: ${{ matrix.cmake_build_type }} | |
- name: Get colcon.meta and .repos files to build fastdds | |
uses: eProsima/eProsima-CI/multiplatform/get_configurations_from_repo@main | |
with: | |
source_repository_branch: ${{ inputs.configuration_branch || env.default_configuration_branch }} | |
colcon_meta_file_path: .github/workflows/configurations/metas/${{ matrix.os }}/colcon.meta | |
repos_file_path: .github/workflows/configurations/fastdds/deps_${{ matrix.fastdds_version }}.repos | |
colcon_meta_file_result: ${{ github.workspace }}/colcon.meta | |
repos_file_result: ${{ github.workspace }}/dependencies.repos | |
- name: Fetch Fast DDS repositories with vcs-tool | |
uses: eProsima/eProsima-CI/multiplatform/vcs_import@main | |
with: | |
vcs_repos_file: ${{ github.workspace }}/dependencies.repos | |
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.fastdds_version }}_${{ matrix.os }}_${{ matrix.cmake_build_type }}${{ inputs.artifacts_name_postfix || env.default_artifact_postfix }} | |
path: ${{ github.workspace }}/artifact/install |