Skip to content

Commit

Permalink
Refs #20822: Avoid building with tests if not running tests
Browse files Browse the repository at this point in the history
Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
  • Loading branch information
JesusPoderoso committed May 28, 2024
1 parent c15e9a4 commit a8871c2
Showing 1 changed file with 38 additions and 16 deletions.
54 changes: 38 additions & 16 deletions .github/workflows/reusable-ubuntu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ defaults:
shell: bash

jobs:
fastdds-build:
fastdds_build:
runs-on: ${{ inputs.os-image }}
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
strategy:
Expand Down Expand Up @@ -118,10 +118,10 @@ jobs:
continue-on-error: false
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
with:
colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/ci.meta
colcon_meta_file: ''
colcon_build_args: ${{ inputs.colcon-args }}
cmake_args: ${{ inputs.cmake-args }}
cmake_args_default: -DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-value -Woverloaded-virtual" -DFASTDDS_EXAMPLE_TESTS=ON
cmake_args_default: -DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-value -Woverloaded-virtual"
cmake_build_type: ${{ matrix.cmake-build-type }}
workspace: ${{ github.workspace }}

Expand All @@ -131,8 +131,8 @@ jobs:
name: fastdds_build_${{ inputs.label }}
path: ${{ github.workspace }}

fastdds-build-test:
needs: fastdds-build
fastdds_build_test:
needs: fastdds_build
runs-on: ${{ inputs.os-image }}
steps:
- name: Download build artifacts
Expand Down Expand Up @@ -179,6 +179,17 @@ jobs:
sudo echo "140.82.121.3 www.foo.com.test" | sudo tee -a /etc/hosts
sudo echo "ff1e::ffff:efff:1 acme.org.test" | sudo tee -a /etc/hosts
- name: Colcon build
continue-on-error: false
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
with:
colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/ci.meta
colcon_build_args: ${{ inputs.colcon-args }}
cmake_args: ${{ inputs.cmake-args }}
cmake_args_default: -DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-value -Woverloaded-virtual" -DFASTDDS_EXAMPLE_TESTS=ON
cmake_build_type: ${{ matrix.cmake-build-type }}
workspace: ${{ github.workspace }}

- name: Colcon test
id: test
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') }}
Expand All @@ -202,8 +213,8 @@ jobs:
show_disabled: 'False'
show_skipped: 'False'

fastdds-python-build:
needs: fastdds-build
fastdds_python_build:
needs: fastdds_build
runs-on: ${{ inputs.os-image }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -261,7 +272,7 @@ jobs:
continue-on-error: false
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
with:
colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/python_colcon.meta
colcon_meta_file: ''
colcon_build_args: '${{ inputs.colcon-args }} --executor parallel --mixin ccache --packages-up-to fastdds_python'
cmake_args: ${{ inputs.cmake-args }}
cmake_args_default: ''
Expand All @@ -274,8 +285,8 @@ jobs:
name: fastdds_python_build_${{ inputs.label }}
path: ${{ github.workspace }}

fastdds-python-build-test:
needs: fastdds-python-build
fastdds_python_build_test:
needs: fastdds_python_build
runs-on: ${{ inputs.os-image }}
steps:
- name: Download python build artifacts
Expand Down Expand Up @@ -310,6 +321,17 @@ jobs:
- name: Setup CCache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0

- name: Colcon build
continue-on-error: false
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
with:
colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/python_colcon.meta
colcon_build_args: '${{ inputs.colcon-args }} --executor parallel --mixin ccache --packages-up-to fastdds_python'
cmake_args: ${{ inputs.cmake-args }}
cmake_args_default: ''
cmake_build_type: ${{ matrix.cmake-build-type }}
workspace: ${{ github.workspace }}

- name: Colcon test
id: python_test
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') }}
Expand All @@ -334,8 +356,8 @@ jobs:
show_disabled: 'False'
show_skipped: 'False'

fastdds-docs-build-test:
needs: fastdds-python-build
fastdds_docs_build_test:
needs: fastdds_python_build
runs-on: ${{ inputs.os-image }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -430,8 +452,8 @@ jobs:
show_disabled: 'False'
show_skipped: 'False'

fastdds-shapesdemo-build:
needs: fastdds-build
fastdds_shapesdemo_build:
needs: fastdds_build
runs-on: ${{ inputs.os-image }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -508,8 +530,8 @@ jobs:
cmake_build_type: ${{ matrix.cmake-build-type }}
workspace: ${{ github.workspace }}

fastdds-discovery-server-build-test:
needs: fastdds-build
fastdds_discovery_server_build_test:
needs: fastdds_build
runs-on: ${{ inputs.os-image }}
strategy:
fail-fast: false
Expand Down

0 comments on commit a8871c2

Please sign in to comment.