Skip to content

Commit 1ad57cf

Browse files
Improve CI workflows in 2.1.x, and branching model refactor (#365) (#369)
* Improve CI workflows in master, and branching model refactor (#365) * Refs #21226: Improve CI workflows in master and apply Fast DDS branching model Signed-off-by: JesusPoderoso <[email protected]> * Refs #21226: Add RELEASE_SUPPORT.md file Signed-off-by: JesusPoderoso <[email protected]> * Refs #21226: Add suggested changes from previous / similar PRs Signed-off-by: JesusPoderoso <[email protected]> * Refs #21226: Apply rev suggestion Signed-off-by: JesusPoderoso <[email protected]> --------- Signed-off-by: JesusPoderoso <[email protected]> (cherry picked from commit d912d11) * Refs #21226: Add option in actions Signed-off-by: JesusPoderoso <[email protected]> --------- Signed-off-by: JesusPoderoso <[email protected]> Co-authored-by: Jesús Poderoso <[email protected]> Co-authored-by: JesusPoderoso <[email protected]>
1 parent 140a46b commit 1ad57cf

File tree

5 files changed

+306
-0
lines changed

5 files changed

+306
-0
lines changed

.github/workflows/config/build.meta

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"

.github/workflows/config/test.repos

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: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
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.6.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.0.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+
skip_base: 'true'
128+
129+
- name: Get Fast CDR branch
130+
id: get_fastcdr_branch
131+
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
132+
with:
133+
remote_repository: eProsima/Fast-CDR
134+
fallback_branch: ${{ inputs.fastcdr-branch }}
135+
skip_base: 'true'
136+
137+
- name: Get Fast DDS Python branch
138+
id: get_fastdds_python_branch
139+
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
140+
with:
141+
remote_repository: eProsima/Fast-DDS-python
142+
fallback_branch: ${{ inputs.fastdds-python-branch }}
143+
skip_base: 'true'
144+
145+
- name: Get Discovery Server branch
146+
id: get_discovery_server_branch
147+
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
148+
with:
149+
remote_repository: eProsima/Discovery-Server
150+
fallback_branch: ${{ inputs.discovery-server-branch }}
151+
skip_base: 'true'
152+
153+
- name: Download Fast CDR, Fast DDS Python, and Discovery Server
154+
run: |
155+
cd src
156+
git clone -b ${{ steps.get_fastcdr_branch.outputs.deduced_branch }} https://github.com/eProsima/Fast-CDR.git fastcdr
157+
git clone -b ${{ steps.get_fastdds_python_branch.outputs.deduced_branch }} https://github.com/eProsima/Fast-DDS-python.git fastdds_python
158+
git clone -b ${{ steps.get_discovery_server_branch.outputs.deduced_branch }} https://github.com/eProsima/Discovery-Server.git discovery_server
159+
cd ..
160+
shell: bash
161+
162+
- name: Download Fast DDS repo
163+
uses: eProsima/eProsima-CI/external/checkout@v0
164+
with:
165+
repository: eProsima/Fast-DDS
166+
path: ${{ github.workspace }}/src/fastrtps
167+
ref: ${{ steps.get_fastdds_branch.outputs.deduced_branch }}
168+
169+
- name: Fetch Fast DDS dependencies
170+
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
171+
with:
172+
vcs_repos_file: ${{ github.workspace }}/src/fastrtps/fastrtps.repos
173+
destination_workspace: src
174+
skip_existing: 'true'
175+
176+
- name: Build fastddsgen
177+
run: |
178+
cd ${{ github.workspace }}/src/fastddsgen
179+
./gradlew assemble
180+
echo "$(pwd)/scripts" >> ${{ github.path }}
181+
182+
- name: Regenerate IDL files for Fast DDS, Fast DDS Python, and Discovery Server
183+
run: |
184+
cd ${{ github.workspace }}/src/fastrtps
185+
./utils/scripts/update_generated_code_from_idl.sh
186+
cd -
187+
188+
cd ${{ github.workspace }}/src/fastdds_python
189+
./utils/scripts/update_generated_code_from_idl.sh
190+
cd -
191+
192+
cd ${{ github.workspace }}/src/discovery_server
193+
./utils/scripts/update_generated_code_from_idl.sh
194+
cd -
195+
196+
- name: Fetch Fast DDS Gen CI dependencies
197+
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
198+
if: ${{ inputs.run-tests == true }}
199+
with:
200+
vcs_repos_file: ${{ github.workspace }}/src/fastddsgen/.github/workflows/config/test.repos
201+
destination_workspace: src
202+
skip_existing: 'true'
203+
204+
- name: Colcon build
205+
continue-on-error: false
206+
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
207+
with:
208+
colcon_meta_file: ${{ github.workspace }}/src/fastddsgen/.github/workflows/config/build.meta
209+
colcon_build_args_default: '--event-handlers=console_direct+'
210+
cmake_build_type: ${{ matrix.cmake-build-type }}
211+
workspace: ${{ github.workspace }}
212+
213+
- name: Test fastddsgen
214+
if: ${{ inputs.run-tests == true }}
215+
run: |
216+
source ${{ github.workspace }}/install/local_setup.bash
217+
cd ${{ github.workspace }}/src/fastddsgen
218+
./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.6.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.0.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-20.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.6.x' }}
65+
fastcdr-branch: ${{ inputs.fastcdr-branch || '1.0.x' }}
66+
fastdds-python-branch: ${{ inputs.fastdds-python-branch || '1.0.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)