Skip to content

Commit

Permalink
Manually set ddspipe version in build workflow (#39)
Browse files Browse the repository at this point in the history
* Manually set ddspipe version in build workflow

Signed-off-by: Raul Sanchez-Mateos <[email protected]>

* Update documentation

Signed-off-by: Raul Sanchez-Mateos <[email protected]>

---------

Signed-off-by: Raul Sanchez-Mateos <[email protected]>
  • Loading branch information
rsanchez15 authored Nov 3, 2023
1 parent c325821 commit 36d1fb8
Show file tree
Hide file tree
Showing 7 changed files with 324 additions and 27 deletions.
162 changes: 142 additions & 20 deletions .github/workflows/build_ddspipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,35 @@
# 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 dependencies.repos and colcon.meta files 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".
#
# ddspipe_branch: branch, tag or commit of eProsima/DDS-Pipe repository.
# Check available branches in https://github.com/eProsima/DDS-Pipe.
#
# build_dev_utils: Flag to re-build eProsima/dev-utils.
# This will run build_dev_utils workflow and wait for the results.
#
# dev_utils_branch: branch, tag or commit of eProsima/dev-utils repository.
# Check available branches in https://github.com/eProsima/dev-utils.
#
# build_fastdds: Flag to re-build Fast DDS.
# This will run build_fastdds workflow and wait for the results.
#
# 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_ddspipe
Expand All @@ -40,15 +64,78 @@ on:
inputs:

built_configuration_branch:
description: Branch or tag of eProsima-CI repository to get .repos and colcon.meta with which the workflow will be executed
description: Branch or tag of eProsima-CI repository to get .repos and colcon.meta with which the workflow will be executed.
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).
required: false
default: _manual

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

build_dev_utils:
description: >
Flag to re-build eProsima/dev-utils.
This will run build_dev_utils workflow and wait for the results.
required: false
type: boolean
default: false

dev_utils_branch:
description: >
Branch, tag or commit of eProsima/dev-utils repository.
Check available branches in https://github.com/eProsima/dev-utils.
required: false
type: string
default: main

build_fastdds:
description: >
Flag to re-build Fast DDS.
This will run build_fastdds workflow and wait for the results.
required: false
type: boolean
default: false

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
Expand All @@ -59,12 +146,30 @@ env:
default_configuration_branch: main
default_artifact_postfix: _nightly
artifact_prefix: built_ddspipe
default_ddspipe_branch: main

jobs:

build_dev_utils:

name: build_dev_utils
uses: eProsima/eProsima-CI/.github/workflows/build_dev_utils.yml@feature/manual-ddspipe-build
if: inputs.build_dev_utils
with:
built_configuration_branch: ${{ inputs.built_configuration_branch }}
use_repos_file: ${{ inputs.use_repos_file }}
artifacts_name_postfix: ${{ inputs.artifacts_name_postfix }}
dev_utils_branch: ${{ inputs.dev_utils_branch }}
build_fastdds: ${{ inputs.build_fastdds }}
foonathan_memory_vendor_branch: ${{ inputs.foonathan_memory_vendor_branch }}
fastcdr_branch: ${{ inputs.fastcdr_branch }}
fastdds_branch: ${{ inputs.fastdds_branch }}

build_ddspipe:

name: build_ddspipe
if: ${{ always() }}
needs: build_dev_utils
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -85,17 +190,6 @@ jobs:

steps:

# TODO fix it
# - name: Wait for dev-utils workflow run to finish
# uses: eProsima/eProsima-CI/external/wait-on-check-action@main
# with:
# check-name: build_dev_utils
# ref: main
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# allowed-conclusions: success,skipped,cancelled,failure
# # each 30 seconds check if finished
# wait-interval: 30

- name: Sync this repository
uses: eProsima/eProsima-CI/external/checkout@main
with:
Expand All @@ -111,8 +205,16 @@ jobs:
with:
cmake_build_type: ${{ matrix.cmake_build_type }}

- name: Get dev_utils artifact
- name: Get dev-utils artifact
uses: eProsima/eProsima-CI/external/download-artifact@main
if: inputs.build_dev_utils
with:
name: built_dev_utils_${{ matrix.os }}_${{ matrix.cmake_build_type }}${{ inputs.artifacts_name_postfix || env.default_artifact_postfix }}
path: install

- name: Get dev-utils artifact
uses: eProsima/eProsima-CI/multiplatform/download_dependency@main
if: (!inputs.build_dev_utils)
with:
artifact_name: built_dev_utils_${{ matrix.os }}_${{ matrix.cmake_build_type }}${{ inputs.artifacts_name_postfix || env.default_artifact_postfix }}
workflow_source: build_dev_utils.yml
Expand All @@ -127,13 +229,33 @@ jobs:
source_repository_branch: ${{ inputs.built_configuration_branch || env.default_configuration_branch }}
colcon_meta_file_path: .github/workflows/configurations/metas/${{ matrix.os }}/colcon.meta
repos_file_path: .github/workflows/configurations/ddspipe/dependencies.repos
colcon_meta_file_result: ${{ github.workspace }}/colcon.meta
repos_file_result: ${{ github.workspace }}/dependencies.repos

- name: Build and generate artifact
uses: eProsima/eProsima-CI/multiplatform/generate_dependency_artifact@main
- name: Fetch DDS Pipe 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 }}/src

- name: Fetch DDS Pipe repositories
uses: eProsima/eProsima-CI/multiplatform/fetch_ddspipe_manual@feature/manual-ddspipe-build
if: (!inputs.use_repos_file)
with:
ddspipe_branch: ${{ inputs.ddspipe_branch || env.default_ddspipe_branch }}
destination_workspace: ${{ github.workspace }}/src

- name: Build workspace
uses: eProsima/eProsima-CI/multiplatform/colcon_build@main
with:
colcon_meta_file: ${{ github.workspace }}/colcon.meta
workspace: ${{ github.workspace }}
workspace_dependencies: install
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 }}/install
70 changes: 68 additions & 2 deletions .github/workflows/build_dev_utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
# This workflow runs every night at 00:00 using latest version of dev-utils (main).
# It waits till Fast DDS workflow has finished.
#
# MANUAL RUN:
# Running this workflow manually, the following arguments might be set:
# MANUAL RUN & WORKFLOW CALL:
# Running this workflow manually or from another workflow, 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]
Expand Down Expand Up @@ -53,6 +53,72 @@ name: build_dev_utils

on:

workflow_call:

inputs:

built_configuration_branch:
description: >
Branch or tag of eProsima-CI repository to get .repos and colcon.meta with which the workflow will be executed.
required: false
type: string
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).
required: false
type: string
default: _manual

dev_utils_branch:
description: >
Branch, tag or commit of eProsima/dev-utils repository.
Check available branches in https://github.com/eProsima/dev-utils.
required: false
type: string
default: main

build_fastdds:
description: >
Flag to re-build Fast DDS.
This will run build_fastdds workflow and wait for the results.
required: false
type: boolean
default: false

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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_fastdds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# SCHEDULE:
# This workflow runs every night at 00:00 using latest version of Fast DDS (master).
#
# MANUAL RUN:
# Running this workflow manually, the following arguments might be set:
# MANUAL RUN & WORKFLOW CALL:
# Running this workflow manually or from another workflow, the following arguments might be set:
#
# built_configuration_branch: set a branch to download colcon.meta file from this repository [Default: main]
#
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,15 @@ 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.

- [fetch_dev_utils_manual](multiplatform/fetch_dev_utils_manual/action.yml)
- Download eProsima/dev-utils setting the specific version of each repository.

- [fetch_ddspipe_manual](multiplatform/fetch_ddspipe_manual/action.yml)
- Download eProsima/dev-utils setting the specific version of each repository.

- [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
34 changes: 34 additions & 0 deletions multiplatform/fetch_ddspipe_manual/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: fetch_ddspipe_manual
description: Download eProsima/DDS-Pipe setting the specific version of each repository

inputs:

ddspipe_branch:
description: >
Branch, tag or commit of eProsima/DDS-Pipe repository.
Check available branches in https://github.com/eProsima/DDS-Pipe.
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_ddspipe_manual@feature/manual-ddspipe-build
if: runner.os == 'Linux'
with:
ddspipe_branch: ${{ inputs.ddspipe_branch }}
destination_workspace: ${{ inputs.destination_workspace }}

- name: Run in windows
uses: eProsima/eProsima-CI/windows/fetch_ddspipe_manual@feature/manual-ddspipe-build
if: runner.os == 'Windows'
with:
ddspipe_branch: ${{ inputs.ddspipe_branch }}
destination_workspace: ${{ inputs.destination_workspace }}
Loading

0 comments on commit 36d1fb8

Please sign in to comment.