diff --git a/.github/workflows/reusable-ubuntu-ci.yml b/.github/workflows/reusable-ubuntu-ci.yml index df99abd5..178dab9f 100644 --- a/.github/workflows/reusable-ubuntu-ci.yml +++ b/.github/workflows/reusable-ubuntu-ci.yml @@ -78,7 +78,6 @@ defaults: jobs: ubuntu-build-test: runs-on: ${{ inputs.os-version }} - if: ${{ inputs.run-build == true }} strategy: fail-fast: false matrix: @@ -86,57 +85,84 @@ jobs: - '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 @@ -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 @@ -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 @@ -161,6 +189,7 @@ 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 @@ -168,6 +197,7 @@ jobs: 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 @@ -177,6 +207,7 @@ 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 @@ -184,6 +215,7 @@ jobs: 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 @@ -191,12 +223,14 @@ jobs: 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 @@ -211,8 +245,8 @@ 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 @@ -220,7 +254,12 @@ jobs: - 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+' @@ -228,6 +267,7 @@ jobs: 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 @@ -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