diff --git a/.github/workflows/build_ddspipe.yml b/.github/workflows/build_ddspipe.yml index 54910637..dbb4ae01 100644 --- a/.github/workflows/build_ddspipe.yml +++ b/.github/workflows/build_ddspipe.yml @@ -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 @@ -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 @@ -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 @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/build_dev_utils.yml b/.github/workflows/build_dev_utils.yml index b06e3ff7..b44f1887 100644 --- a/.github/workflows/build_dev_utils.yml +++ b/.github/workflows/build_dev_utils.yml @@ -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] @@ -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: diff --git a/.github/workflows/build_fastdds.yml b/.github/workflows/build_fastdds.yml index 2d0182ac..7581387e 100644 --- a/.github/workflows/build_fastdds.yml +++ b/.github/workflows/build_fastdds.yml @@ -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] # diff --git a/README.md b/README.md index db7fc8f9..106ae294 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/multiplatform/fetch_ddspipe_manual/action.yml b/multiplatform/fetch_ddspipe_manual/action.yml new file mode 100644 index 00000000..306ece9a --- /dev/null +++ b/multiplatform/fetch_ddspipe_manual/action.yml @@ -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 }} diff --git a/ubuntu/fetch_ddspipe_manual/action.yml b/ubuntu/fetch_ddspipe_manual/action.yml new file mode 100644 index 00000000..a9907a8b --- /dev/null +++ b/ubuntu/fetch_ddspipe_manual/action.yml @@ -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 diff --git a/windows/fetch_ddspipe_manual/action.yml b/windows/fetch_ddspipe_manual/action.yml new file mode 100644 index 00000000..54c09add --- /dev/null +++ b/windows/fetch_ddspipe_manual/action.yml @@ -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::"