|
| 1 | +name: Fast DDS Docs 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: false |
| 9 | + default: 'ubuntu-22.04' |
| 10 | + type: string |
| 11 | + label: |
| 12 | + description: 'ID associated to the workflow' |
| 13 | + required: true |
| 14 | + type: string |
| 15 | + colcon-args: |
| 16 | + description: 'Extra arguments for colcon cli' |
| 17 | + required: false |
| 18 | + type: string |
| 19 | + cmake-args: |
| 20 | + description: 'Extra arguments for cmake cli' |
| 21 | + required: false |
| 22 | + type: string |
| 23 | + ctest-args: |
| 24 | + description: 'Extra arguments for ctest cli' |
| 25 | + required: false |
| 26 | + type: string |
| 27 | + fastdds-docs-branch: |
| 28 | + description: 'Branch or tag of Fast DDS Docs repository' |
| 29 | + required: true |
| 30 | + type: string |
| 31 | + fastdds-branch: |
| 32 | + description: 'Branch or tag of Fast DDS repository' |
| 33 | + required: true |
| 34 | + type: string |
| 35 | + fastdds-python-branch: |
| 36 | + description: 'Branch or tag of Fast DDS Python repository' |
| 37 | + required: true |
| 38 | + type: string |
| 39 | + run-build: |
| 40 | + description: 'Build Fast DDS Docs (CI skipped otherwise)' |
| 41 | + required: false |
| 42 | + type: boolean |
| 43 | + default: true |
| 44 | + run-tests: |
| 45 | + description: 'Run test suite of Fast DDS Docs' |
| 46 | + required: false |
| 47 | + type: boolean |
| 48 | + default: true |
| 49 | + use-ccache: |
| 50 | + description: 'Use CCache to speed up the build' |
| 51 | + required: false |
| 52 | + type: boolean |
| 53 | + default: false |
| 54 | +env: |
| 55 | + build-meta: ${{ inputs.run-tests == true && './src/fastdds-docs/.github/workflows/config/build.meta ./src/fastdds-docs/.github/workflows/config/test.meta' || './src/fastdds-docs/.github/workflows/config/build.meta' }} |
| 56 | +defaults: |
| 57 | + run: |
| 58 | + shell: bash |
| 59 | + |
| 60 | +jobs: |
| 61 | + reusable-ubuntu-ci: |
| 62 | + runs-on: ${{ inputs.os-version }} |
| 63 | + if: ${{ inputs.run-build == true }} |
| 64 | + strategy: |
| 65 | + fail-fast: false |
| 66 | + matrix: |
| 67 | + cmake-build-type: |
| 68 | + - 'RelWithDebInfo' |
| 69 | + steps: |
| 70 | + - name: Add ci-pending label if PR |
| 71 | + if: ${{ github.event_name == 'pull_request' }} |
| 72 | + uses: eProsima/eProsima-CI/external/add_labels@v0 |
| 73 | + with: |
| 74 | + labels: ci-pending |
| 75 | + number: ${{ github.event.number }} |
| 76 | + repo: eProsima/Fast-DDS-docs |
| 77 | + |
| 78 | + - name: Sync eProsima/Fast-DDS-docs repository |
| 79 | + uses: eProsima/eProsima-CI/external/checkout@v0 |
| 80 | + with: |
| 81 | + path: src/fastdds-docs |
| 82 | + ref: ${{ inputs.fastdds-docs-branch }} |
| 83 | + |
| 84 | + - name: Install Fix Python version |
| 85 | + uses: eProsima/eProsima-CI/external/setup-python@v0 |
| 86 | + with: |
| 87 | + python-version: '3.11' |
| 88 | + |
| 89 | + - name: Get minimum supported version of CMake |
| 90 | + uses: eProsima/eProsima-CI/external/get-cmake@v0 |
| 91 | + with: |
| 92 | + cmakeVersion: '3.22.6' |
| 93 | + |
| 94 | + - name: Install apt dependencies |
| 95 | + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 |
| 96 | + with: |
| 97 | + packages: libasio-dev libtinyxml2-dev libssl-dev swig doxygen imagemagick plantuml |
| 98 | + update: false |
| 99 | + upgrade: false |
| 100 | + |
| 101 | + - name: Install colcon |
| 102 | + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 |
| 103 | + |
| 104 | + - name: Install Python dependencies |
| 105 | + uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 |
| 106 | + with: |
| 107 | + packages: vcstool xmlschema |
| 108 | + upgrade: false |
| 109 | + |
| 110 | + - name: Install Fast DDS Docs required python packages |
| 111 | + uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 |
| 112 | + with: |
| 113 | + upgrade: false |
| 114 | + requirements_file_name: src/fastdds-docs/docs/requirements.txt |
| 115 | + |
| 116 | + - name: Setup CCache |
| 117 | + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 |
| 118 | + if: ${{ inputs.use-ccache == true }} |
| 119 | + with: |
| 120 | + api_token: ${{ secrets.GITHUB_TOKEN }} |
| 121 | + |
| 122 | + - name: Get Fast DDS branch |
| 123 | + id: get_fastdds_branch |
| 124 | + uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0 |
| 125 | + with: |
| 126 | + remote_repository: eProsima/Fast-DDS |
| 127 | + fallback_branch: ${{ inputs.fastdds-branch }} |
| 128 | + |
| 129 | + - name: Obtain Fast DDS dependencies |
| 130 | + uses: eProsima/eProsima-CI/multiplatform/get_file_from_repo@v0 |
| 131 | + with: |
| 132 | + source_repository_branch: ${{ steps.get_fastdds_branch.outputs.deduced_branch }} |
| 133 | + source_repository: eProsima/Fast-DDS |
| 134 | + file_name: fastrtps.repos |
| 135 | + file_result: ${{ github.workspace }}/fastrtps.repos |
| 136 | + |
| 137 | + - name: Fetch Fast DDS dependencies |
| 138 | + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 |
| 139 | + with: |
| 140 | + vcs_repos_file: ${{ github.workspace }}/fastrtps.repos |
| 141 | + destination_workspace: src |
| 142 | + skip_existing: 'true' |
| 143 | + |
| 144 | + - name: Get Fast DDS Python branch |
| 145 | + id: get_fastdds_python_branch |
| 146 | + uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0 |
| 147 | + with: |
| 148 | + remote_repository: eProsima/Fast-DDS-python |
| 149 | + fallback_branch: ${{ inputs.fastdds-python-branch }} |
| 150 | + |
| 151 | + - name: Obtain Fast DDS Python dependencies |
| 152 | + uses: eProsima/eProsima-CI/external/checkout@v0 |
| 153 | + with: |
| 154 | + path: src/fastdds_python |
| 155 | + repository: eProsima/Fast-DDS-python |
| 156 | + ref: ${{ steps.get_fastdds_python_branch.outputs.deduced_branch }} |
| 157 | + |
| 158 | + - name: Fetch Fast DDS Docs CI dependencies |
| 159 | + if: ${{ inputs.run-tests == true }} |
| 160 | + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 |
| 161 | + with: |
| 162 | + vcs_repos_file: ${{ github.workspace }}/src/fastdds-docs/.github/workflows/config/test.repos |
| 163 | + destination_workspace: src |
| 164 | + skip_existing: 'true' |
| 165 | + |
| 166 | + - name: Colcon build |
| 167 | + continue-on-error: false |
| 168 | + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 |
| 169 | + with: |
| 170 | + colcon_meta_file: ${{ env.build-meta }} |
| 171 | + colcon_build_args: ${{ inputs.colcon-args }} |
| 172 | + cmake_args: ${{ inputs.cmake-args }} |
| 173 | + cmake_build_type: ${{ matrix.cmake-build-type }} |
| 174 | + workspace: ${{ github.workspace }} |
| 175 | + |
| 176 | + - name: Colcon test |
| 177 | + if: ${{ inputs.run-tests == true }} |
| 178 | + id: fastdds_docs_test |
| 179 | + uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 |
| 180 | + with: |
| 181 | + colcon_meta_file: ${{ github.workspace }}/src/fastdds-docs/.github/workflows/config/test.meta |
| 182 | + colcon_test_args: ${{ inputs.colcon-args }} |
| 183 | + colcon_test_args_default: --event-handlers=console_direct+ |
| 184 | + ctest_args: ${{ inputs.ctest-args }} |
| 185 | + packages_names: fastdds-docs |
| 186 | + workspace: ${{ github.workspace }} |
| 187 | + workspace_dependencies: '' |
| 188 | + test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} |
| 189 | + |
| 190 | + - name: Fast DDS Docs test summary |
| 191 | + uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 |
| 192 | + if: ${{ !cancelled() && inputs.run-tests == true }} |
| 193 | + with: |
| 194 | + junit_reports_dir: "${{ steps.fastdds_docs_test.outputs.ctest_results_path }}" |
| 195 | + print_summary: 'True' |
| 196 | + show_failed: 'True' |
| 197 | + show_disabled: 'False' |
| 198 | + show_skipped: 'False' |
0 commit comments