Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 46 additions & 6 deletions .github/workflows/reusable-ubuntu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,65 +78,91 @@ defaults:
jobs:
ubuntu-build-test:
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' && inputs.add-label == true }}
if: ${{ inputs.run-build == true && github.event_name == 'pull_request' && inputs.add-label == true }}
uses: eProsima/eProsima-CI/external/add_labels@v0
with:
labels: ci-pending
number: ${{ github.event.number }}
repo: eProsima/Fast-DDS-Gen

<<<<<<< HEAD
=======
- name: Free disk space
if: ${{ inputs.run-build == true }}
uses: eProsima/eProsima-CI/ubuntu/free_disk_space@v0

>>>>>>> 724b278 (Make `skip-ci` label report required statuses as pass (#581))
- name: Sync eProsima/Fast-DDS-Gen repository
if: ${{ inputs.run-build == true }}
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: ${{ github.workspace }}/src/fastddsgen
ref: ${{ inputs.fastddsgen-branch }}

- name: Install Fix Python version
if: ${{ inputs.run-build == true }}
uses: eProsima/eProsima-CI/external/setup-python@v0
with:
python-version: '3.11'

- name: Get minimum supported version of CMake
if: ${{ inputs.run-build == true }}
uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
cmakeVersion: 3.22.6

- name: Install apt packages
if: ${{ inputs.run-build == true }}
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: libasio-dev libtinyxml2-dev libssl-dev swig ${{ inputs.java-version }}

- name: Configure Java to ${{ inputs.java-version }}
shell: bash
if: ${{ inputs.run-build == true }}
run: |
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"
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"
<<<<<<< HEAD
=======
export JAVA_HOME=$(dirname $(dirname `readlink -f /etc/alternatives/java`))
echo JAVA_HOME="$JAVA_HOME" >> $GITHUB_ENV

- name: Verify Java version
if: ${{ inputs.run-build == true }}
run: |
java -version
javac --version
echo $JAVA_HOME
>>>>>>> 724b278 (Make `skip-ci` label report required statuses as pass (#581))

- name: Install colcon
if: ${{ inputs.run-build == true }}
uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0

- name: Install Python dependencies
if: ${{ inputs.run-build == true }}
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
if: ${{ inputs.run-build == true && inputs.use-ccache == true }}
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
if: ${{ inputs.run-build == true }}
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
with:
remote_repository: eProsima/Fast-DDS
Expand All @@ -145,6 +171,7 @@ jobs:

- name: Get Fast CDR branch
id: get_fastcdr_branch
if: ${{ inputs.run-build == true }}
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
with:
remote_repository: eProsima/Fast-CDR
Expand All @@ -153,6 +180,7 @@ jobs:

- name: Get Fast DDS Python branch
id: get_fastdds_python_branch
if: ${{ inputs.run-build == true }}
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
with:
remote_repository: eProsima/Fast-DDS-python
Expand All @@ -161,13 +189,15 @@ jobs:

- name: Get Discovery Server branch
id: get_discovery_server_branch
if: ${{ inputs.run-build == true }}
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
with:
remote_repository: eProsima/Discovery-Server
fallback_branch: ${{ inputs.discovery-server-branch }}
skip_base: true

- name: Download Fast CDR, Fast DDS Python, and Discovery Server
if: ${{ inputs.run-build == true }}
run: |
cd src
git clone -b ${{ steps.get_fastcdr_branch.outputs.deduced_branch }} https://github.com/eProsima/Fast-CDR.git fastcdr
Expand All @@ -177,26 +207,30 @@ jobs:
shell: bash

- name: Download Fast DDS repo
if: ${{ inputs.run-build == true }}
uses: eProsima/eProsima-CI/external/checkout@v0
with:
repository: eProsima/Fast-DDS
path: ${{ github.workspace }}/src/fastrtps
ref: ${{ steps.get_fastdds_branch.outputs.deduced_branch }}

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

- name: Build fastddsgen
if: ${{ inputs.run-build == true }}
run: |
cd ${{ github.workspace }}/src/fastddsgen
./gradlew assemble
echo "$(pwd)/scripts" >> ${{ github.path }}

- name: Regenerate IDL files for Fast DDS, Fast DDS Python, and Discovery Server
if: ${{ inputs.run-build == true }}
run: |
cd ${{ github.workspace }}/src/fastrtps
./utils/scripts/update_generated_code_from_idl.sh
Expand All @@ -211,23 +245,29 @@ jobs:
cd -

- name: Fetch Fast DDS Gen CI dependencies
if: ${{ inputs.run-build == true }}
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
if: ${{ inputs.run-tests == true }}
with:
vcs_repos_file: ${{ github.workspace }}/src/fastddsgen/.github/workflows/config/test.repos
destination_workspace: src
skip_existing: 'true'

- name: Colcon build
continue-on-error: false
<<<<<<< HEAD
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
=======
if: ${{ inputs.run-build == true }}
uses: eProsima/eProsima-CI/ubuntu/colcon_build@v0
>>>>>>> 724b278 (Make `skip-ci` label report required statuses as pass (#581))
with:
colcon_meta_file: ${{ github.workspace }}/src/fastddsgen/.github/workflows/config/build.meta
colcon_build_args_default: '--event-handlers=console_direct+'
cmake_build_type: ${{ matrix.cmake-build-type }}
workspace: ${{ github.workspace }}

- name: Clean workspace to save space
if: ${{ inputs.run-build == true }}
run: |
rm -rf ${{ github.workspace }}/build
rm -rf ${{ github.workspace }}/src/fastcdr
Expand All @@ -236,14 +276,14 @@ jobs:
rm -rf ${{ github.workspace }}/src/discovery_server

- name: Test fastddsgen
if: ${{ inputs.run-tests == true }}
if: ${{ inputs.run-build == true && inputs.run-tests == true }}
run: |
source ${{ github.workspace }}/install/local_setup.bash
cd ${{ github.workspace }}/src/fastddsgen
./gradlew test ${{ env.cdr-test-flag }}

- name: Test fastddsgen with python arg
if: ${{ inputs.run-tests == true }}
if: ${{ inputs.run-build == true && inputs.run-tests == true }}
run: |
source ${{ github.workspace }}/install/local_setup.bash
cd ${{ github.workspace }}/src/fastddsgen/thirdparty/dds-types-test/IDL
Expand Down