Skip to content

Commit 2f781a0

Browse files
Improve CI workflows in 2.5.x, and branching model refactor (#365) (#368)
* Refs #21226: Improve CI workflows in master and apply Fast DDS branching model Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #21226: Add RELEASE_SUPPORT.md file Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #21226: Add suggested changes from previous / similar PRs Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> * Refs #21226: Apply rev suggestion Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> --------- Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com> (cherry picked from commit d912d11) Co-authored-by: Jesús Poderoso <120394830+JesusPoderoso@users.noreply.github.com>
1 parent c619563 commit 2f781a0

File tree

6 files changed

+302
-55
lines changed

6 files changed

+302
-55
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 55 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
names:
2+
fastdds:
3+
cmake-args:
4+
- "-DEPROSIMA_BUILD_TESTS=ON"
5+
fastdds_python:
6+
cmake-args:
7+
- "-DBUILD_TESTING=ON"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repositories:
2+
googletest-distribution:
3+
type: git
4+
url: https://github.com/google/googletest.git
5+
version: release-1.11.0
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
name: Fast DDS Gen Ubuntu CI reusable workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os-version:
7+
description: 'The OS image for the workflow'
8+
required: true
9+
type: string
10+
java-version:
11+
description: 'The Java version to be used'
12+
required: true
13+
type: string
14+
label:
15+
description: 'ID associated to the workflow'
16+
required: true
17+
type: string
18+
fastddsgen-branch:
19+
description: 'Fast DDS Gen branch to be used'
20+
required: true
21+
type: string
22+
fastdds-branch:
23+
description: 'Branch or tag of Fast DDS repository'
24+
required: false
25+
type: string
26+
default: '2.10.x'
27+
fastcdr-branch:
28+
description: 'Branch or tag of Fast CDR repository'
29+
required: false
30+
type: string
31+
default: '1.0.x'
32+
fastdds-python-branch:
33+
description: 'Branch or tag of Fast DDS Python repository'
34+
required: false
35+
type: string
36+
default: '1.2.x'
37+
discovery-server-branch:
38+
description: 'Branch or tag of Discovery Server repository'
39+
required: false
40+
type: string
41+
default: 'v1.2.1'
42+
run-build:
43+
description: 'Build Fast DDS Gen'
44+
required: false
45+
type: boolean
46+
default: true
47+
run-tests:
48+
description: 'Run test suite of Fast DDS Gen'
49+
required: false
50+
type: boolean
51+
default: true
52+
use-ccache:
53+
description: 'Use CCache to speed up the build'
54+
required: false
55+
type: boolean
56+
default: false
57+
defaults:
58+
run:
59+
shell: bash
60+
61+
jobs:
62+
ubuntu-build-test:
63+
runs-on: ${{ inputs.os-version }}
64+
if: ${{ inputs.run-build == true }}
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
cmake-build-type:
69+
- 'RelWithDebInfo'
70+
steps:
71+
- name: Add ci-pending label if PR
72+
if: ${{ github.event_name == 'pull_request' }}
73+
uses: eProsima/eProsima-CI/external/add_labels@v0
74+
with:
75+
labels: ci-pending
76+
number: ${{ github.event.number }}
77+
repo: eProsima/Fast-DDS-Gen
78+
79+
- name: Sync eProsima/Fast-DDS-Gen repository
80+
uses: eProsima/eProsima-CI/external/checkout@v0
81+
with:
82+
path: ${{ github.workspace }}/src/fastddsgen
83+
ref: ${{ inputs.fastddsgen-branch }}
84+
85+
- name: Install Fix Python version
86+
uses: eProsima/eProsima-CI/external/setup-python@v0
87+
with:
88+
python-version: '3.11'
89+
90+
- name: Get minimum supported version of CMake
91+
uses: eProsima/eProsima-CI/external/get-cmake@v0
92+
with:
93+
cmakeVersion: 3.22.6
94+
95+
- name: Install apt packages
96+
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
97+
with:
98+
packages: libasio-dev libtinyxml2-dev libssl-dev swig ${{ inputs.java-version }}
99+
100+
- name: Configure Java to ${{ inputs.java-version }}
101+
shell: bash
102+
run: |
103+
jv=$(echo ${{ inputs.java-version }} | sed -r 's/.*-([0-9]*)-.*/\1/g'); jvs=$(update-alternatives --list java | grep "$jv" | head -1); sudo update-alternatives --set java "$jvs"
104+
jv=$(echo ${{ inputs.java-version }} | sed -r 's/.*-([0-9]*)-.*/\1/g'); jvs=$(update-alternatives --list javac | grep "$jv" | head -1); sudo update-alternatives --set javac "$jvs"
105+
106+
- name: Install colcon
107+
uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0
108+
109+
- name: Install Python dependencies
110+
uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
111+
with:
112+
packages: vcstool xmlschema xmltodict==0.13.0 jsondiff==2.0.0 pandas==1.5.2
113+
upgrade: false
114+
115+
- name: Setup CCache
116+
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0
117+
if: ${{ inputs.use-ccache == true }}
118+
with:
119+
api_token: ${{ secrets.GITHUB_TOKEN }}
120+
121+
- name: Get Fast DDS branch
122+
id: get_fastdds_branch
123+
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
124+
with:
125+
remote_repository: eProsima/Fast-DDS
126+
fallback_branch: ${{ inputs.fastdds-branch }}
127+
128+
- name: Get Fast CDR branch
129+
id: get_fastcdr_branch
130+
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
131+
with:
132+
remote_repository: eProsima/Fast-CDR
133+
fallback_branch: ${{ inputs.fastcdr-branch }}
134+
135+
- name: Get Fast DDS Python branch
136+
id: get_fastdds_python_branch
137+
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
138+
with:
139+
remote_repository: eProsima/Fast-DDS-python
140+
fallback_branch: ${{ inputs.fastdds-python-branch }}
141+
142+
- name: Get Discovery Server branch
143+
id: get_discovery_server_branch
144+
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
145+
with:
146+
remote_repository: eProsima/Discovery-Server
147+
fallback_branch: ${{ inputs.discovery-server-branch }}
148+
149+
- name: Download Fast CDR, Fast DDS Python, and Discovery Server
150+
run: |
151+
cd src
152+
git clone -b ${{ steps.get_fastcdr_branch.outputs.deduced_branch }} https://github.com/eProsima/Fast-CDR.git fastcdr
153+
git clone -b ${{ steps.get_fastdds_python_branch.outputs.deduced_branch }} https://github.com/eProsima/Fast-DDS-python.git fastdds_python
154+
git clone -b ${{ steps.get_discovery_server_branch.outputs.deduced_branch }} https://github.com/eProsima/Discovery-Server.git discovery_server
155+
cd ..
156+
shell: bash
157+
158+
- name: Download Fast DDS repo
159+
uses: eProsima/eProsima-CI/external/checkout@v0
160+
with:
161+
repository: eProsima/Fast-DDS
162+
path: ${{ github.workspace }}/src/fastrtps
163+
ref: ${{ steps.get_fastdds_branch.outputs.deduced_branch }}
164+
165+
- name: Fetch Fast DDS dependencies
166+
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
167+
with:
168+
vcs_repos_file: ${{ github.workspace }}/src/fastrtps/fastrtps.repos
169+
destination_workspace: src
170+
skip_existing: 'true'
171+
172+
- name: Build fastddsgen
173+
run: |
174+
cd ${{ github.workspace }}/src/fastddsgen
175+
./gradlew assemble
176+
echo "$(pwd)/scripts" >> ${{ github.path }}
177+
178+
- name: Regenerate IDL files for Fast DDS, Fast DDS Python, and Discovery Server
179+
run: |
180+
cd ${{ github.workspace }}/src/fastrtps
181+
./utils/scripts/update_generated_code_from_idl.sh
182+
cd -
183+
184+
cd ${{ github.workspace }}/src/fastdds_python
185+
./utils/scripts/update_generated_code_from_idl.sh
186+
cd -
187+
188+
cd ${{ github.workspace }}/src/discovery_server
189+
./utils/scripts/update_generated_code_from_idl.sh
190+
cd -
191+
192+
- name: Fetch Fast DDS Gen CI dependencies
193+
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
194+
if: ${{ inputs.run-tests == true }}
195+
with:
196+
vcs_repos_file: ${{ github.workspace }}/src/fastddsgen/.github/workflows/config/test.repos
197+
destination_workspace: src
198+
skip_existing: 'true'
199+
200+
- name: Colcon build
201+
continue-on-error: false
202+
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
203+
with:
204+
colcon_meta_file: ${{ github.workspace }}/src/fastddsgen/.github/workflows/config/build.meta
205+
colcon_build_args_default: '--event-handlers=console_direct+'
206+
cmake_build_type: ${{ matrix.cmake-build-type }}
207+
workspace: ${{ github.workspace }}
208+
209+
- name: Test fastddsgen
210+
if: ${{ inputs.run-tests == true }}
211+
run: |
212+
source ${{ github.workspace }}/install/local_setup.bash
213+
cd ${{ github.workspace }}/src/fastddsgen
214+
./gradlew test

.github/workflows/ubuntu-ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Fast DDS Gen Ubuntu CI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
fastddsgen-branch:
7+
description: 'Fast DDS Gen branch to be used'
8+
required: true
9+
type: string
10+
fastdds-branch:
11+
description: 'Branch or tag of Fast DDS repository'
12+
required: false
13+
type: string
14+
default: '2.10.x'
15+
fastcdr-branch:
16+
description: 'Branch or tag of Fast CDR repository'
17+
required: false
18+
type: string
19+
default: '1.0.x'
20+
fastdds-python-branch:
21+
description: 'Branch or tag of Fast DDS Python repository'
22+
required: false
23+
type: string
24+
default: '1.2.x'
25+
discovery-server-branch:
26+
description: 'Branch or tag of Discovery Server repository'
27+
required: false
28+
type: string
29+
default: 'v1.2.1'
30+
run-tests:
31+
description: 'Run test suite of Fast DDS Gen'
32+
required: false
33+
type: boolean
34+
default: true
35+
use-ccache:
36+
description: 'Use CCache to speed up the build'
37+
required: false
38+
type: boolean
39+
default: false
40+
41+
pull_request:
42+
types:
43+
- review_requested
44+
paths-ignore:
45+
- '**.md'
46+
- '**.txt'
47+
- '!**/CMakeLists.txt'
48+
49+
concurrency:
50+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
51+
cancel-in-progress: true
52+
53+
jobs:
54+
ubuntu-ci:
55+
if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }}
56+
uses: ./.github/workflows/reusable-ubuntu-ci.yml
57+
with:
58+
# It would be desirable to have a matrix of ubuntu OS for this job, but due to the issue opened in this ticket:
59+
# https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job.
60+
os-version: 'ubuntu-22.04'
61+
java-version: 'openjdk-11-jdk'
62+
label: 'ubuntu-ci-openjdk-11-jdk'
63+
fastddsgen-branch: ${{ inputs.fastddsgen-branch || github.ref }}
64+
fastdds-branch: ${{ inputs.fastdds-branch || '2.10.x' }}
65+
fastcdr-branch: ${{ inputs.fastcdr-branch || '1.0.x' }}
66+
fastdds-python-branch: ${{ inputs.fastdds-python-branch || '1.2.x' }}
67+
discovery-server-branch: ${{ inputs.discovery-server-branch || 'v1.2.1' }}
68+
run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
69+
run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }}
70+
use-ccache: ${{ (inputs.use-ccache == true) || false }}

RELEASE_SUPPORT.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Release support
2+
3+
4+
Please, refer to the [master branch](https://github.com/eProsima/Fast-DDS-Gen/blob/master/RELEASE_SUPPORT.md) for the latest version of this document.
5+
6+
For detailed information about the lifecycle of the different *Fast DDS* versions (and their corresponding counterpart in this repository), please refer to the [release support section of the Fast DDS repository](https://github.com/eProsima/Fast-DDS/blob/master/RELEASE_SUPPORT.md).

0 commit comments

Comments
 (0)