Skip to content

Commit

Permalink
Manually build dev-utils artifact (#38)
Browse files Browse the repository at this point in the history
* Manually set dev-utils version in build workflow

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

* Run fastdds build in same workflow as dev-utils

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

* Select fastdds build depending on input params

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

* Extend workflow description and fix dev-utils branch

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

* Unzip downloaded artifact

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

* Fix artifact destination folder

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

* Update branch to main

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

---------

Signed-off-by: Raul Sanchez-Mateos <[email protected]>
  • Loading branch information
rsanchez15 authored Oct 27, 2023
1 parent d7cdcfb commit c325821
Show file tree
Hide file tree
Showing 7 changed files with 311 additions and 21 deletions.
140 changes: 119 additions & 21 deletions .github/workflows/build_dev_utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,29 @@
# 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".
#
# 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_dev_utils
Expand All @@ -40,15 +58,64 @@ 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).
description: >
Addition to artifacts name creation (do not use _nightly postfix when creating artifacts with specific arguments).
required: false
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
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 +126,28 @@ env:
default_configuration_branch: main
default_artifact_postfix: _nightly
artifact_prefix: built_dev_utils
default_dev_utils_branch: main

jobs:

build_fastdds:

name: build_fastdds
uses: eProsima/eProsima-CI/.github/workflows/build_fastdds.yml@main
if: inputs.build_fastdds
with:
built_configuration_branch: ${{ inputs.built_configuration_branch }}
use_repos_file: ${{ inputs.use_repos_file }}
artifacts_name_postfix: ${{ inputs.artifacts_name_postfix }}
foonathan_memory_vendor_branch: ${{ inputs.foonathan_memory_vendor_branch }}
fastcdr_branch: ${{ inputs.fastcdr_branch }}
fastdds_branch: ${{ inputs.fastdds_branch }}

build_dev_utils:

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

steps:

# TODO fix it
# - name: Wait for Fast DDS workflow run to finish
# uses: eProsima/eProsima-CI/external/wait-on-check-action@main
# with:
# check-name: build_fastdds
# 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 @@ -106,8 +178,16 @@ jobs:
with:
cmake_build_type: ${{ matrix.cmake_build_type }}

- name: Get fastdds artifact
- name: Get Fast DDS artifact
uses: eProsima/eProsima-CI/external/download-artifact@main
if: inputs.build_fastdds
with:
name: built_fastdds_${{ matrix.os }}_${{ matrix.cmake_build_type }}${{ inputs.artifacts_name_postfix || env.default_artifact_postfix }}
path: install

- name: Get Fast DDS artifact
uses: eProsima/eProsima-CI/multiplatform/download_dependency@main
if: (!inputs.build_fastdds)
with:
artifact_name: built_fastdds_${{ matrix.os }}_${{ matrix.cmake_build_type }}${{ inputs.artifacts_name_postfix || env.default_artifact_postfix }}
workflow_source: build_fastdds.yml
Expand All @@ -125,12 +205,30 @@ jobs:
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 dev-utils 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 dev-utils repositories
uses: eProsima/eProsima-CI/multiplatform/fetch_dev_utils_manual@main
if: (!inputs.use_repos_file)
with:
dev_utils_branch: ${{ inputs.dev_utils_branch || env.default_dev_utils_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
58 changes: 58 additions & 0 deletions .github/workflows/build_fastdds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,59 @@ name: build_fastdds

on:

workflow_call:

inputs:

built_configuration_branch:
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
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

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 All @@ -53,6 +106,7 @@ on:
true) that will be applied.
required: false
type: string
default: main

use_repos_file:
Expand All @@ -68,27 +122,31 @@ on:
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:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ For more information about versioning handle of this project, check following [f
- [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.

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

Expand Down Expand Up @@ -216,6 +219,9 @@ Run the `manual_build` workflow with these arguments:
> :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.

> :page_facing_up: eProsima/dev-utils build allows to specify the version as inputs of the workflow.
In order to use the manually set versions instead of the one 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
22 changes: 22 additions & 0 deletions external/download-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'download-artifact'
description: 'https://github.com/actions/upload-artifact/blob/main/action.yml'

inputs:

name:
description: 'Artifact name'
required: false

path:
description: 'Destination path'
required: false

runs:
using: composite
steps:

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
34 changes: 34 additions & 0 deletions multiplatform/fetch_dev_utils_manual/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: fetch_dev_utils_manual
description: Download eProsima/dev-utils setting the specific version of each repository

inputs:

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
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_dev_utils_manual@main
if: runner.os == 'Linux'
with:
dev_utils_branch: ${{ inputs.dev_utils_branch }}
destination_workspace: ${{ inputs.destination_workspace }}

- name: Run in windows
uses: eProsima/eProsima-CI/windows/fetch_dev_utils_manual@main
if: runner.os == 'Windows'
with:
dev_utils_branch: ${{ inputs.dev_utils_branch }}
destination_workspace: ${{ inputs.destination_workspace }}
Loading

0 comments on commit c325821

Please sign in to comment.