|
| 1 | +# Reusable workflow to run the following jobs: |
| 2 | +# |
| 3 | +# - multiplatform-tests |
| 4 | +# - [ ubuntu-22.04 | ubuntu-24.04 ] |
| 5 | +# - [ Debug | Release ] |
| 6 | +# - execute tests in different versions of ubuntu with different build types |
| 7 | +# |
| 8 | +# - asan |
| 9 | +# - ubuntu-22.04 |
| 10 | +# - execute tests with ASAN flag |
| 11 | +# |
| 12 | +# - tsan |
| 13 | +# - ubuntu-22.04 |
| 14 | +# - execute tests with TSAN flag |
| 15 | +# |
| 16 | +# - clang |
| 17 | +# - ubuntu-22.04 |
| 18 | +# - execute clang-tidy check |
| 19 | +# |
| 20 | +# - coverage |
| 21 | +# - ubuntu-22.04 |
| 22 | +# - execute test with coverage flag and upload results |
| 23 | +# |
| 24 | +# - flaky |
| 25 | +# - ubuntu-22.04 |
| 26 | +# - execute flaky tests |
| 27 | +# |
| 28 | +# - docs |
| 29 | +# - ubuntu-22.04 |
| 30 | +# - execute docs compile and tests |
| 31 | +# |
| 32 | +# - uncrustify |
| 33 | +# - ubuntu-22.04 |
| 34 | +# - test uncrustify |
| 35 | +# |
| 36 | +# - python-linter |
| 37 | +# - ubuntu-22.04 |
| 38 | +# - test python linter |
| 39 | +# |
| 40 | + |
| 41 | +name: ubuntu-ci |
| 42 | + |
| 43 | +on: |
| 44 | + |
| 45 | + workflow_call: |
| 46 | + inputs: |
| 47 | + |
| 48 | + custom_version_build: |
| 49 | + description: > |
| 50 | + Version of Fast DDS build from eProsima-CI. |
| 51 | + required: true |
| 52 | + type: string |
| 53 | + |
| 54 | + dependencies_artifact_postfix: |
| 55 | + description: > |
| 56 | + 'Postfix name to add to artifact name to download dependencies. |
| 57 | + This is use to download a specific artifact version from eProsima-CI.' |
| 58 | + required: true |
| 59 | + default: '_nightly' |
| 60 | + type: string |
| 61 | + |
| 62 | + ref: |
| 63 | + description: > |
| 64 | + The branch or tag name to checkout. |
| 65 | + required: true |
| 66 | + type: string |
| 67 | + default: 'main' |
| 68 | + |
| 69 | +env: |
| 70 | + code_packages_names: 'fastdds_statistics_backend' |
| 71 | + docs_packages_names: 'fastdds_statistics_backend' |
| 72 | + |
| 73 | +jobs: |
| 74 | + |
| 75 | +##################################################################### |
| 76 | +# TEST |
| 77 | + |
| 78 | + multiplatform-tests: |
| 79 | + name: ${{ matrix.os }}-ci |
| 80 | + strategy: |
| 81 | + fail-fast: false |
| 82 | + matrix: |
| 83 | + os: |
| 84 | + - ubuntu-22.04 |
| 85 | + - ubuntu-24.04 |
| 86 | + uses: ./.github/workflows/reusable-workflow.yml |
| 87 | + with: |
| 88 | + os: ${{ matrix.os }} |
| 89 | + custom_version_build: ${{ inputs.custom_version_build || 'v3' }} |
| 90 | + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix || '_nightly' }} |
| 91 | + ref: ${{ inputs.ref }} |
| 92 | + secrets: inherit |
| 93 | + |
| 94 | +##################################################################### |
| 95 | +# ASAN |
| 96 | + |
| 97 | + asan: |
| 98 | + runs-on: ubuntu-22.04 |
| 99 | + steps: |
| 100 | + |
| 101 | + - name: Sync repository |
| 102 | + uses: eProsima/eProsima-CI/external/checkout@v0 |
| 103 | + with: |
| 104 | + path: src |
| 105 | + ref: ${{ inputs.ref }} |
| 106 | + |
| 107 | + - name: Download dependencies and install requirements |
| 108 | + uses: ./src/.github/actions/project_dependencies |
| 109 | + with: |
| 110 | + os: ubuntu-22.04 |
| 111 | + cmake_build_type: Release |
| 112 | + custom_version_build: ${{ inputs.custom_version_build }} |
| 113 | + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }} |
| 114 | + secret_token: ${{ secrets.GITHUB_TOKEN }} |
| 115 | + |
| 116 | + - name: Compile and run tests |
| 117 | + id: compile_and_test |
| 118 | + uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@v0 |
| 119 | + with: |
| 120 | + packages_names: ${{ env.code_packages_names }} |
| 121 | + cmake_args: -DBUILD_TESTS=ON -DASAN_BUILD=ON |
| 122 | + ctest_args: --label-exclude "xfail|xtsan" |
| 123 | + workspace_dependencies: install |
| 124 | + cmake_build_type: Debug |
| 125 | + test_report_artifact: test_report_asan${{ inputs.dependencies_artifact_postfix }}_${{ inputs.custom_version_build }} |
| 126 | + |
| 127 | + - name: Test Report |
| 128 | + uses: eProsima/eProsima-CI/external/test-reporter@v0 |
| 129 | + if: success() || failure() |
| 130 | + with: |
| 131 | + name: "Report: ASAN " |
| 132 | + path: "${{ steps.compile_and_test.outputs.ctest_results_path }}*.xml" |
| 133 | + working-directory: 'src' |
| 134 | + list-tests: 'failed' |
| 135 | + |
| 136 | +##################################################################### |
| 137 | +# TSAN |
| 138 | + |
| 139 | + tsan: |
| 140 | + runs-on: ubuntu-22.04 |
| 141 | + steps: |
| 142 | + |
| 143 | + - name: Sync repository |
| 144 | + uses: eProsima/eProsima-CI/external/checkout@v0 |
| 145 | + with: |
| 146 | + path: src |
| 147 | + ref: ${{ inputs.ref }} |
| 148 | + |
| 149 | + - name: Download dependencies and install requirements |
| 150 | + uses: ./src/.github/actions/project_dependencies |
| 151 | + with: |
| 152 | + os: ubuntu-22.04 |
| 153 | + cmake_build_type: Release |
| 154 | + custom_version_build: ${{ inputs.custom_version_build }} |
| 155 | + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }} |
| 156 | + secret_token: ${{ secrets.GITHUB_TOKEN }} |
| 157 | + |
| 158 | + - name: Compile and run tests |
| 159 | + id: compile_and_test |
| 160 | + uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@v0 |
| 161 | + with: |
| 162 | + packages_names: ${{ env.code_packages_names }} |
| 163 | + cmake_args: -DBUILD_TESTS=ON -DTSAN_BUILD=ON |
| 164 | + ctest_args: --label-exclude "xfail|xasan" |
| 165 | + workspace_dependencies: install |
| 166 | + cmake_build_type: Debug |
| 167 | + test_report_artifact: test_report_tsan${{ inputs.dependencies_artifact_postfix }}_${{ inputs.custom_version_build }} |
| 168 | + |
| 169 | + - name: Test Report |
| 170 | + uses: eProsima/eProsima-CI/external/test-reporter@v0 |
| 171 | + if: success() || failure() |
| 172 | + with: |
| 173 | + name: "Report: TSAN " |
| 174 | + path: "${{ steps.compile_and_test.outputs.ctest_results_path }}*.xml" |
| 175 | + working-directory: 'src' |
| 176 | + list-tests: 'failed' |
| 177 | + |
| 178 | +##################################################################### |
| 179 | +# CLANG |
| 180 | + |
| 181 | + clang: |
| 182 | + runs-on: ubuntu-22.04 |
| 183 | + steps: |
| 184 | + |
| 185 | + - name: Sync repository |
| 186 | + uses: eProsima/eProsima-CI/external/checkout@v0 |
| 187 | + with: |
| 188 | + path: src |
| 189 | + ref: ${{ inputs.ref }} |
| 190 | + |
| 191 | + - name: Download dependencies and install requirements |
| 192 | + uses: ./src/.github/actions/project_dependencies |
| 193 | + with: |
| 194 | + os: ubuntu-22.04 |
| 195 | + cmake_build_type: Release |
| 196 | + custom_version_build: ${{ inputs.custom_version_build }} |
| 197 | + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }} |
| 198 | + secret_token: ${{ secrets.GITHUB_TOKEN }} |
| 199 | + |
| 200 | + - name: Compile and run tests |
| 201 | + uses: eProsima/eProsima-CI/multiplatform/clang_build_test@v0 |
| 202 | + with: |
| 203 | + packages_names: ${{ env.code_packages_names }} |
| 204 | + workspace_dependencies: install |
| 205 | + |
| 206 | +##################################################################### |
| 207 | +# COVERAGE |
| 208 | + |
| 209 | + coverage: |
| 210 | + runs-on: ubuntu-22.04 |
| 211 | + environment: |
| 212 | + name: codecov |
| 213 | + steps: |
| 214 | + |
| 215 | + - name: Sync repository |
| 216 | + uses: eProsima/eProsima-CI/external/checkout@v0 |
| 217 | + with: |
| 218 | + path: src |
| 219 | + ref: ${{ inputs.ref }} |
| 220 | + |
| 221 | + - name: Download dependencies and install requirements |
| 222 | + uses: ./src/.github/actions/project_dependencies |
| 223 | + with: |
| 224 | + os: ubuntu-22.04 |
| 225 | + cmake_build_type: Release |
| 226 | + custom_version_build: ${{ inputs.custom_version_build }} |
| 227 | + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }} |
| 228 | + secret_token: ${{ secrets.GITHUB_TOKEN }} |
| 229 | + |
| 230 | + - name: Compile and run tests |
| 231 | + uses: eProsima/eProsima-CI/ubuntu/coverage_build_test_upload@v0 |
| 232 | + with: |
| 233 | + packages_names: ${{ env.code_packages_names }} |
| 234 | + workspace_dependencies: install |
| 235 | + codecov_token: ${{ secrets.CODECOV_TOKEN }} |
| 236 | + codecov_fix_file_path: src/codecov.yml |
| 237 | + test_report_artifact: test_report_coverage${{ inputs.dependencies_artifact_postfix }}_${{ inputs.custom_version_build }} |
| 238 | + |
| 239 | + |
| 240 | +##################################################################### |
| 241 | +# FLAKY |
| 242 | + |
| 243 | + flaky: |
| 244 | + runs-on: ubuntu-22.04 |
| 245 | + steps: |
| 246 | + |
| 247 | + - name: Sync repository |
| 248 | + uses: eProsima/eProsima-CI/external/checkout@v0 |
| 249 | + with: |
| 250 | + path: src |
| 251 | + ref: ${{ inputs.ref }} |
| 252 | + |
| 253 | + - name: Download dependencies and install requirements |
| 254 | + uses: ./src/.github/actions/project_dependencies |
| 255 | + with: |
| 256 | + os: ubuntu-22.04 |
| 257 | + cmake_build_type: Release |
| 258 | + custom_version_build: ${{ inputs.custom_version_build }} |
| 259 | + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }} |
| 260 | + secret_token: ${{ secrets.GITHUB_TOKEN }} |
| 261 | + |
| 262 | + - name: Compile and run tests |
| 263 | + id: compile_and_test |
| 264 | + uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@v0 |
| 265 | + with: |
| 266 | + packages_names: ${{ env.code_packages_names }} |
| 267 | + workspace_dependencies: install |
| 268 | + ctest_args: --label-regex "xfail" |
| 269 | + |
| 270 | + - name: Test Report |
| 271 | + uses: eProsima/eProsima-CI/external/test-reporter@v0 |
| 272 | + if: success() || failure() |
| 273 | + with: |
| 274 | + name: "Report: Flaky " |
| 275 | + path: "${{ steps.compile_and_test.outputs.ctest_results_path }}*.xml" |
| 276 | + working-directory: 'src' |
| 277 | + fail-on-empty: 'false' |
| 278 | + list-tests: 'failed' |
| 279 | + |
| 280 | +##################################################################### |
| 281 | +# DOCUMENTATION TEST |
| 282 | + |
| 283 | + docs: |
| 284 | + runs-on: ubuntu-22.04 |
| 285 | + steps: |
| 286 | + |
| 287 | + - name: Sync repository |
| 288 | + uses: eProsima/eProsima-CI/external/checkout@v0 |
| 289 | + with: |
| 290 | + path: src |
| 291 | + ref: ${{ inputs.ref }} |
| 292 | + |
| 293 | + - name: Install libtinyxml in ubuntu |
| 294 | + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 |
| 295 | + with: |
| 296 | + packages: libtinyxml2-dev |
| 297 | + |
| 298 | + - name: Install doxygen |
| 299 | + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 |
| 300 | + with: |
| 301 | + packages: doxygen |
| 302 | + |
| 303 | + - name: Build and test documentation |
| 304 | + uses: eProsima/eProsima-CI/ubuntu/sphinx_docs@v0 |
| 305 | + with: |
| 306 | + checkout_path: src/fastdds_statistics_backend |
| 307 | + custom_version_build: ${{ inputs.custom_version_build }} |
| 308 | + path_to_requirements: src/fastdds_statistics_backend/docs/requirements.txt |
| 309 | + docs_subpackage_name: ${{ env.docs_packages_names }} |
| 310 | + secret_token: ${{ secrets.GITHUB_TOKEN }} |
| 311 | + upload_test_report_artifact: false |
| 312 | + upload_artifact: false |
| 313 | + |
| 314 | + |
| 315 | +##################################################################### |
| 316 | +# UNCRUSTIFY |
| 317 | + |
| 318 | + uncrustify: |
| 319 | + runs-on: ubuntu-22.04 |
| 320 | + steps: |
| 321 | + |
| 322 | + - name: Sync repository |
| 323 | + uses: eProsima/eProsima-CI/external/checkout@v0 |
| 324 | + with: |
| 325 | + path: src |
| 326 | + ref: ${{ inputs.ref }} |
| 327 | + |
| 328 | + - name: Uncrustify |
| 329 | + uses: eProsima/eProsima-CI/ubuntu/uncrustify@v0 |
0 commit comments