diff --git a/.github/workflows/reusable-ubuntu-ci.yml b/.github/workflows/reusable-ubuntu-ci.yml index e8015865..92e73d3d 100644 --- a/.github/workflows/reusable-ubuntu-ci.yml +++ b/.github/workflows/reusable-ubuntu-ci.yml @@ -60,7 +60,6 @@ defaults: jobs: fastdds_python_build: runs-on: ${{ inputs.os-version }} - if: ${{ inputs.run-build == true }} strategy: fail-fast: false matrix: @@ -68,7 +67,7 @@ jobs: - 'RelWithDebInfo' steps: - name: Add ci-pending label if PR - if: ${{ github.event_name == 'pull_request' }} + if: ${{ inputs.run-build == true && github.event_name == 'pull_request' }} uses: eProsima/eProsima-CI/external/add_labels@v0 with: labels: ci-pending @@ -76,22 +75,26 @@ jobs: repo: eProsima/Fast-DDS-Python - name: Sync eProsima/Fast-DDS-Python repository + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/external/checkout@v0 with: path: src/fastdds_python ref: ${{ inputs.fastdds-python-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 dependencies + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 with: packages: libasio-dev libtinyxml2-dev libssl-dev swig doxygen @@ -99,22 +102,25 @@ jobs: upgrade: false - name: Install colcon + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/ubuntu/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 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 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 @@ -122,6 +128,7 @@ jobs: skip_base: true - name: Download Fast CDR + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/external/checkout@v0 with: repository: eProsima/Fast-CDR @@ -130,12 +137,14 @@ jobs: - 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 fallback_branch: ${{ inputs.fastdds-branch }} - name: Download Fast DDS repo + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/external/checkout@v0 with: repository: eProsima/Fast-DDS @@ -143,6 +152,7 @@ jobs: ref: ${{ steps.get_fastdds_branch.outputs.deduced_branch }} - name: Fetch Fast DDS Python dependencies + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: vcs_repos_file: ${{ github.workspace }}/src/fastdds_python/fastdds_python.repos @@ -150,6 +160,7 @@ jobs: skip_existing: 'true' - name: Colcon build + if: ${{ inputs.run-build == true }} continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: @@ -160,6 +171,7 @@ jobs: workspace: ${{ github.workspace }} - name: Upload build artifacts + if: ${{ inputs.run-build == true && inputs.run-tests == true }} uses: eProsima/eProsima-CI/external/upload-artifact@v0 with: name: fastdds_python_build_${{ inputs.label }} @@ -168,7 +180,6 @@ jobs: fastdds_python_test: needs: fastdds_python_build runs-on: ${{ inputs.os-version }} - if: ${{ inputs.run-tests == true }} strategy: fail-fast: false matrix: @@ -176,42 +187,49 @@ jobs: - 'RelWithDebInfo' steps: - name: Download python build artifacts + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/external/download-artifact@v0 with: name: fastdds_python_build_${{ inputs.label }} path: ${{ github.workspace }} - name: Install Fix Python version + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/external/setup-python@v0 with: python-version: '3.11' - name: Get minimum supported version of CMake + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/external/get-cmake@v0 with: cmakeVersion: '3.22.6' - name: Install apt packages + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 with: packages: libasio-dev libtinyxml2-dev libssl-dev swig - name: Install colcon + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 - name: Install Python dependencies + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 with: packages: xmlschema pytest - name: Setup CCache + if: ${{ inputs.run-tests == 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: Colcon build continue-on-error: false + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/ubuntu_test.meta @@ -224,6 +242,7 @@ jobs: - name: Colcon test id: python_test + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 with: colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/ubuntu_test.meta @@ -237,7 +256,7 @@ jobs: - name: Fast DDS Python test summary uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 - if: ${{ !cancelled() }} + if: ${{ inputs.run-tests == true && !cancelled() }} with: junit_reports_dir: "${{ steps.python_test.outputs.ctest_results_path }}" print_summary: 'True' diff --git a/.github/workflows/reusable-windows-ci.yml b/.github/workflows/reusable-windows-ci.yml index 765ab2c2..2c79ab0b 100644 --- a/.github/workflows/reusable-windows-ci.yml +++ b/.github/workflows/reusable-windows-ci.yml @@ -61,7 +61,6 @@ defaults: jobs: fastdds_python_build: runs-on: ${{ inputs.os-version }} - if: ${{ inputs.run-build == true }} strategy: fail-fast: false matrix: @@ -70,7 +69,7 @@ jobs: steps: - name: Add ci-pending label if PR - if: ${{ github.event_name == 'pull_request' }} + if: ${{ inputs.run-build == true && github.event_name == 'pull_request' }} uses: eProsima/eProsima-CI/external/add_labels@v0 with: labels: ci-pending @@ -78,27 +77,32 @@ jobs: repo: eProsima/Fast-DDS-Python - name: Sync eProsima/Fast-DDS-Python repository + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/external/checkout@v0 with: path: src/fastdds_python ref: ${{ inputs.fastdds-python-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 OpenSSL + if: ${{ inputs.run-build == true }} uses: eProsima/eprosima-CI/windows/install_openssl@v0 with: version: '3.1.1' - name: Update OpenSSL environment variables + if: ${{ inputs.run-build == true }} run: | # Update the environment if (Test-Path -Path $Env:ProgramW6432\OpenSSL) @@ -120,19 +124,23 @@ jobs: } - name: Install colcon + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/windows/install_colcon@v0 - name: Install Python dependencies + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/windows/install_python_packages@v0 with: packages: vcstool xmlschema pywin32 - name: Install swig + if: ${{ inputs.run-build == true }} shell: pwsh run: choco install swig --allow-downgrade --version=4.0.2.04082020 - 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 @@ -140,6 +148,7 @@ jobs: skip_base: true - name: Download Fast CDR + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/external/checkout@v0 with: repository: eProsima/Fast-CDR @@ -148,12 +157,14 @@ jobs: - name: Get Fast DDS branch id: get_fastdds_branch + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/multiplatform/get_related_branch_from_repo@v0 with: remote_repository: eProsima/Fast-DDS fallback_branch: ${{ inputs.fastdds-branch }} - name: Download Fast DDS repo + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/external/checkout@v0 with: repository: eProsima/Fast-DDS @@ -161,6 +172,7 @@ jobs: ref: ${{ steps.get_fastdds_branch.outputs.deduced_branch }} - name: Fetch Fast DDS Python dependencies + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: vcs_repos_file: ${{ github.workspace }}/src/fastdds_python/fastdds_python.repos @@ -169,6 +181,7 @@ jobs: - name: Colcon build continue-on-error: false + if: ${{ inputs.run-build == true }} uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta @@ -180,6 +193,7 @@ jobs: workspace: ${{ github.workspace }} - name: Upload build artifacts + if: ${{ inputs.run-build == true && inputs.run-tests == true }} uses: eProsima/eProsima-CI/external/upload-artifact@v0 with: name: fastdds_python_build_${{ inputs.label }} @@ -189,7 +203,6 @@ jobs: fastdds_python_test: needs: fastdds_python_build runs-on: ${{ inputs.os-version }} - if: ${{ inputs.run-tests == true }} strategy: fail-fast: false matrix: @@ -197,27 +210,32 @@ jobs: - 'RelWithDebInfo' steps: - name: Download python build artifacts + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/external/download-artifact@v0 with: name: fastdds_python_build_${{ inputs.label }} path: ${{ github.workspace }} - name: Install Fix Python version + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/external/setup-python@v0 with: python-version: '3.11' - name: Get minimum supported version of CMake + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/external/get-cmake@v0 with: cmakeVersion: '3.22.6' - name: Install OpenSSL + if: ${{ inputs.run-tests == true }} uses: eProsima/eprosima-CI/windows/install_openssl@v0 with: version: '3.1.1' - name: Update OpenSSL environment variables + if: ${{ inputs.run-tests == true }} run: | # Update the environment if (Test-Path -Path $Env:ProgramW6432\OpenSSL) @@ -239,22 +257,27 @@ jobs: } - name: Install colcon + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/windows/install_colcon@v0 - name: Install Python dependencies + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/windows/install_python_packages@v0 with: packages: vcstool xmlschema pywin32 pytest - name: Install swig + if: ${{ inputs.run-tests == true }} shell: pwsh run: choco install swig --allow-downgrade --version=4.0.2.04082020 - name: Install doxygen + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/external/install_doxygen@v0 - name: Colcon build continue-on-error: false + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/windows_test.meta @@ -268,6 +291,7 @@ jobs: - name: Colcon test id: python_test + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 with: colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/windows_test.meta @@ -281,7 +305,7 @@ jobs: - name: Test summary uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 - if: ${{ !cancelled() }} + if: ${{ inputs.run-tests == true && !cancelled() }} with: junit_reports_dir: "${{ steps.python_test.outputs.ctest_results_path }}" print_summary: 'True' diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index 5eddcb6b..cea86e70 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -65,5 +65,5 @@ jobs: fastdds-python-branch: ${{ inputs.fastdds-python-branch || github.ref }} fastdds-branch: ${{ inputs.fastdds-branch || '2.14.x' }} run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} - run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }} + run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test')) && !contains(github.event.pull_request.labels.*.name, 'skip-ci')) }} use-ccache: ${{ inputs.use-ccache || false }} diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 206d671d..2cc08485 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -68,4 +68,4 @@ jobs: fastdds-python-branch: ${{ inputs.fastdds-python-branch || github.ref }} fastdds-branch: ${{ inputs.fastdds-branch || '2.14.x' }} run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} - run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }} + run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test')) && !contains(github.event.pull_request.labels.*.name, 'skip-ci')) }}