Skip to content

Commit

Permalink
Manually set ddspipe version in build workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sanchez-Mateos <[email protected]>
  • Loading branch information
rsanchez15 committed Nov 2, 2023
1 parent c325821 commit 7398d1a
Show file tree
Hide file tree
Showing 5 changed files with 285 additions and 15 deletions.
128 changes: 113 additions & 15 deletions .github/workflows/build_ddspipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,74 @@ on:
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 +122,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 +166,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 +181,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 +205,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
66 changes: 66 additions & 0 deletions .github/workflows/build_dev_utils.yml
Original file line number Diff line number Diff line change
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
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 }}
36 changes: 36 additions & 0 deletions ubuntu/fetch_ddspipe_manual/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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: fetch_ddspipe_manual
run: |
echo "::group::Manually clone DDS Pipe repository"
echo "Downloading following dependencies:"
echo " - DDS Pipe: ${{ inputs.ddspipe_branch }}"
mkdir -p ${{ inputs.destination_workspace }}
cd ${{ inputs.destination_workspace }}
git clone --branch ${{ inputs.ddspipe_branch }} https://github.com/eProsima/DDS-Pipe.git
echo "::endgroup::"
shell: bash
36 changes: 36 additions & 0 deletions windows/fetch_ddspipe_manual/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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: fetch_ddspipe_manual
shell: pwsh
run: |
"::group::Manually clone DDS Pipe repository"
Write-Host 'Downloading following dependencies:'
Write-Host ' - DDS Pipe: ${{ inputs.ddspipe_branch }}'
New-Item -ItemType Directory -Force -Path ${{ inputs.destination_workspace }}
Set-Location -Path ${{ inputs.destination_workspace }}
git clone --branch ${{ inputs.ddspipe_branch }} https://github.com/eProsima/DDS-Pipe.git
"::endgroup::"

0 comments on commit 7398d1a

Please sign in to comment.