Skip to content

Commit

Permalink
Migrate Discovery Server CI to Github (#90)
Browse files Browse the repository at this point in the history
* Refs #21230: Migrate Discovery Server CI to Github

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>

* Refs #21230: Add RELEASE_SUPPORT.md file

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>

* Refs #21230: Add missing flaxy test arg

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>

* Refs #21230:  Introduce improvements from similar PR reviews

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>

* Refs #21230: Apply rev suggestions

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>

* Refs #21230: Add missing CI checks in PR template

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>

---------

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
(cherry picked from commit c323886)

# Conflicts:
#	.github/pull_request_template.md
  • Loading branch information
JesusPoderoso authored and mergify[bot] committed Jul 1, 2024
1 parent 6356505 commit 4c4824f
Show file tree
Hide file tree
Showing 8 changed files with 458 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!-- Provide a general summary of your changes in the Title above -->
<!-- It must be meaningful and coherent with the changes -->

<!--
If this PR is still a Work in Progress [WIP], please open it as DRAFT.
Please consider if any label should be added to this PR.
If no code has been changed, please add `skip-ci` label.
If opening the PR as Draft, please consider adding `no-test` label to only build the code but not run CI.
If documentation PR is still pending, please add `doc-pending` label.
-->

## Description

<!--
Describe changes in detail.
This includes depicting the context, use case or current behavior and describe the proposed changes.
If several features/bug fixes are included with these changes, please consider opening separated pull requests.
-->

<!--
In case of bug fixes, please provide the list of supported branches where this fix should be also merged.
Please uncomment following line, adjusting the corresponding target branches for the backport.
-->
<!-- @Mergifyio backport 1.2.x -->

<!-- If an issue is already opened, please uncomment next line with the corresponding issue number. -->
<!-- Fixes #(issue) -->

<!-- In case the changes are built over a previous pull request, please uncomment next line. -->
<!-- This PR depends on #(PR) and must be merged after that one. -->

## Contributor Checklist

<!--
- If any of the elements of the following checklist is not applicable, substitute the checkbox [ ] by _N/A_:
- If any of the elements of the following checklist is not fulfilled on purpose, please provide a reason and substitute the checkbox [ ] with ❌: or __NO__:.
-->

- [ ] Commit messages follow the project guidelines. <!-- External contributors should sign the DCO. Fast DDS developers must also refer to the internal Redmine task. -->
- [ ] The added tests pass locally.
- [ ] Changes are backwards compatible. <!-- Bug fixes should be ABI compatible if possible so a backport to previous affected releases can be made. -->
- [ ] New feature has been documented/Current behavior is correctly described in the documentation.
- [ ] Applicable backports have been included in the description.

## Reviewer Checklist

- [ ] The PR has a milestone assigned.
- [ ] The title and description correctly express the PR's purpose.
- [ ] Check contributor checklist is correct.
- [ ] Check CI results: changes do not issue any warning.
- [ ] Check CI results: failing tests are unrelated with the changes.
5 changes: 5 additions & 0 deletions .github/workflows/config/build.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
names:
fastdds:
cmake-args:
- "-DNO_TLS=ON"
- "-DSECURITY=OFF"
11 changes: 11 additions & 0 deletions .github/workflows/config/test.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
names:
fastdds:
cmake-args:
- "-DCOMPILE_TOOLS=ON"
- "-DINSTALL_TOOLS=ON"
discovery-server:
ctest-args: [
"--repeat", "until-pass:3",
"--timeout", "300",
"--label-exclude", "xfail"
]
5 changes: 5 additions & 0 deletions .github/workflows/config/test.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repositories:
googletest-distribution:
type: git
url: https://github.com/google/googletest.git
version: release-1.11.0
61 changes: 61 additions & 0 deletions .github/workflows/nightly-ubuntu-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Fast DDS Discovery Server Ubuntu CI (nightly)

on:
workflow_dispatch:
schedule:
- cron: '0 1 * * *'

jobs:
nightly-ubuntu-ci-master:
uses: eProsima/Discovery-Server/.github/workflows/reusable-ubuntu-ci.yml@master
with:
# It would be desirable to have a matrix of ubuntu OS for this job, but due to the issue opened in this ticket:
# https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job.
os-image: 'ubuntu-22.04'
label: 'nightly-ubuntu-ci-master'
discovery-server-branch: 'master'
fastdds-branch: 'master'
ctest-args: "-LE xfail"
run-build: true
run-tests: true
use-ccache: false

nightly-ubuntu-ci-v1_2_2:
strategy:
fail-fast: false
matrix:
fastdds-branch:
- '2.14.x'
- '2.13.x'
uses: eProsima/Discovery-Server/.github/workflows/reusable-ubuntu-ci.yml@1.2.x
with:
# It would be desirable to have a matrix of ubuntu OS for this job, but due to the issue opened in this ticket:
# https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job.
os-image: 'ubuntu-22.04'
label: 'nightly-ubuntu-ci-v1.2.2-${{ matrix.fastdds-branch }}'
discovery-server-branch: 'v1.2.2'
fastdds-branch: ${{ matrix.fastdds-branch }}
ctest-args: "-LE xfail"
run-build: true
run-tests: true
use-ccache: false

nightly-ubuntu-ci-v1_2_1:
strategy:
fail-fast: false
matrix:
setup:
- os-image: 'ubuntu-22.04'
fastdds-branch: '2.10.x'
- os-image: 'ubuntu-20.04'
fastdds-branch: '2.6.x'
uses: eProsima/Discovery-Server/.github/workflows/reusable-ubuntu-ci.yml@1.2.x
with:
os-image: ${{ matrix.setup.os-image }}
label: 'nightly-ubuntu-ci-v1.2.1-${{ matrix.setup.fastdds-branch }}'
discovery-server-branch: 'v1.2.1'
fastdds-branch: ${{ matrix.setup.fastdds-branch }}
ctest-args: "-LE xfail"
run-build: true
run-tests: true
use-ccache: false
237 changes: 237 additions & 0 deletions .github/workflows/reusable-ubuntu-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
name: Fast DDS Discovery Server Ubuntu CI reusable workflow

on:
workflow_call:
inputs:
os-version:
description: 'The OS image for the workflow'
required: false
default: 'ubuntu-22.04'
type: string
label:
description: 'ID associated to the workflow'
required: true
type: string
colcon-args:
description: 'Extra arguments for colcon cli'
required: false
type: string
cmake-args:
description: 'Extra arguments for cmake cli'
required: false
type: string
ctest-args:
description: 'Extra arguments for ctest cli'
required: false
type: string
discovery-server-branch:
description: 'Branch or tag of Discovery Server repository'
required: true
type: string
fastdds-branch:
description: 'Branch or tag of Fast DDS repository'
required: true
type: string
run-build:
description: 'Build Fast DDS Discovery Server (CI skipped otherwise)'
required: false
type: boolean
default: true
run-tests:
description: 'Run test suite of Fast DDS Discovery Server'
required: false
type: boolean
default: true
use-ccache:
description: 'Use CCache to speed up the build'
required: false
type: boolean
default: false
env:
colcon-build-default-cmake-args: '-DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-value -Woverloaded-virtual"'
defaults:
run:
shell: bash

jobs:
discovery_server_build:
runs-on: ${{ inputs.os-version }}
if: ${{ inputs.run-build == true }}
strategy:
fail-fast: false
matrix:
cmake-build-type:
- 'RelWithDebInfo'
steps:
- name: Add ci-pending label if PR
if: ${{ github.event_name == 'pull_request' }}
uses: eProsima/eProsima-CI/external/add_labels@v0
with:
labels: ci-pending
number: ${{ github.event.number }}
repo: eProsima/Discovery-Server

- name: Sync eProsima/Discovery-Server repository
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src/discovery_server
ref: ${{ inputs.discovery-server-branch }}

- name: Install Fix Python version
uses: eProsima/eProsima-CI/external/setup-python@v0
with:
python-version: '3.11'

- name: Get minimum supported version of CMake
uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
cmakeVersion: '3.22.6'

- name: Install apt dependencies
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: libasio-dev libtinyxml2-dev libssl-dev
update: false
upgrade: false

- name: Install colcon
uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0

- name: Install Python dependencies
uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
with:
packages: vcstool xmlschema xmltodict==0.13.0 jsondiff==2.0.0 pandas==1.5.2
upgrade: false

- name: Setup CCache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0
if: ${{ inputs.use-ccache == true }}
with:
api_token: ${{ secrets.GITHUB_TOKEN }}

- name: Get Fast DDS branch
id: get_fastdds_branch
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
with:
remote_repository: eProsima/Fast-DDS
fallback_branch: ${{ inputs.fastdds-branch }}

- name: Download Fast DDS repo
uses: eProsima/eProsima-CI/external/checkout@v0
with:
repository: eProsima/Fast-DDS
path: src/fastdds
ref: ${{ steps.get_fastdds_branch.outputs.deduced_branch }}

- name: Fetch Fast DDS dependencies
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
with:
vcs_repos_file: ${{ github.workspace }}/src/fastdds/fastdds.repos
destination_workspace: src
skip_existing: 'true'

- name: Colcon build
continue-on-error: false
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
with:
colcon_meta_file: ${{ github.workspace }}/src/discovery_server/.github/workflows/config/build.meta
colcon_build_args: ${{ inputs.colcon-args }}
cmake_args: ${{ inputs.cmake-args }}
cmake_args_default: ${{ env.colcon-build-default-cmake-args }}
cmake_build_type: ${{ matrix.cmake-build-type }}
workspace: ${{ github.workspace }}

- name: Upload build artifacts
uses: eProsima/eProsima-CI/external/upload-artifact@v0
with:
name: discovery_server_build_${{ inputs.label }}
path: ${{ github.workspace }}

discovery_server_tests:
needs: discovery_server_build
runs-on: ${{ inputs.os-version }}
strategy:
fail-fast: false
matrix:
cmake-build-type:
- 'RelWithDebInfo'
steps:
- name: Download build artifacts
uses: eProsima/eProsima-CI/external/download-artifact@v0
with:
name: discovery_server_build_${{ inputs.label }}
path: ${{ github.workspace }}

- name: Install Fix Python version
uses: eProsima/eProsima-CI/external/setup-python@v0
with:
python-version: '3.11'

- name: Get minimum supported version of CMake
uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
cmakeVersion: '3.22.6'

- name: Install apt dependencies
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: libasio-dev libtinyxml2-dev libssl-dev
update: false
upgrade: false

- name: Install colcon
uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0

- name: Install Python dependencies
uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
with:
packages: vcstool xmlschema xmltodict==0.13.0 jsondiff==2.0.0 pandas==1.5.2
upgrade: false

- name: Setup CCache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0
if: ${{ inputs.use-ccache == true }}
with:
api_token: ${{ secrets.GITHUB_TOKEN }}

- name: Fetch Fast DDS CI dependencies
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
with:
vcs_repos_file: ${{ github.workspace }}/src/discovery_server/.github/workflows/config/test.repos
destination_workspace: src
skip_existing: 'true'

- name: Colcon build
continue-on-error: false
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
with:
colcon_meta_file: ${{ github.workspace }}/src/discovery_server/.github/workflows/config/build.meta ${{ github.workspace }}/src/discovery_server/.github/workflows/config/test.meta
colcon_build_args: ${{ inputs.colcon-args }}
cmake_args: ${{ inputs.cmake-args }}
cmake_args_default: ${{ env.colcon-build-default-cmake-args }}
cmake_build_type: ${{ matrix.cmake-build-type }}
workspace: ${{ github.workspace }}

- name: Colcon test
id: discovery_server_test
if: ${{ inputs.run-tests == true }}
uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0
with:
colcon_meta_file: ${{ github.workspace }}/src/discovery_server/.github/workflows/config/test.meta
colcon_test_args: ${{ inputs.colcon-args }}
colcon_test_args_default: --event-handlers=console_direct+
ctest_args: ${{ inputs.ctest-args }}
packages_names: discovery-server
workspace: ${{ github.workspace }}
workspace_dependencies: ''
test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }}

- name: Test summary
uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0
if: ${{ !cancelled() && inputs.run-tests == true }}
with:
junit_reports_dir: "${{ steps.discovery_server_test.outputs.ctest_results_path }}"
print_summary: 'True'
show_failed: 'True'
show_disabled: 'False'
show_skipped: 'False'
Loading

0 comments on commit 4c4824f

Please sign in to comment.