diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..2ca237c4 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,50 @@ + + + + + +## Description + + + + + + + + + + + +## Contributor Checklist + + + +- [ ] Commit messages follow the project guidelines. +- [ ] The code follows the style guidelines of this project. +- [ ] Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally +- [ ] Any new/modified methods have been properly documented using Doxygen. +- [ ] Changes are backport compatible: they do **NOT** break ABI nor change library core behavior. +- [ ] Changes are API compatible. +- [ ] New feature has been added to the `versions.md` file (if applicable). +- [ ] Applicable backports have been included in the description. + +## Reviewer Checklist + +- [ ] The PR has a milestone assigned. +- [ ] The title and description correctly express the PR's purpose. +- [ ] Check contributor checklist is correct. +- [ ] Check CI results: changes do not issue any warning. +- [ ] Check CI results: CI pass and failing tests are unrelated with the changes. diff --git a/.github/workflows/config/build.meta b/.github/workflows/config/build.meta new file mode 100644 index 00000000..12fc4c7d --- /dev/null +++ b/.github/workflows/config/build.meta @@ -0,0 +1,10 @@ +names: + fastcdr: + cmake-args: + - "-DEPROSIMA_BUILD_TESTS=ON" + googletest-distribution: + cmake-args: + - "-Dgtest_force_shared_crt=ON" + - "-DBUILD_SHARED_LIBS=ON" + - "-DBUILD_GMOCK=ON" + diff --git a/.github/workflows/config/test.meta b/.github/workflows/config/test.meta new file mode 100644 index 00000000..9112ed4a --- /dev/null +++ b/.github/workflows/config/test.meta @@ -0,0 +1,7 @@ +names: + fastcdr: + ctest-args: [ + "--repeat", "until-pass:3", + "--timeout", "300", + "--output-junit", "junit/junit.xml" + ] diff --git a/.github/workflows/config/test.repos b/.github/workflows/config/test.repos new file mode 100644 index 00000000..5052ee82 --- /dev/null +++ b/.github/workflows/config/test.repos @@ -0,0 +1,5 @@ +repositories: + googletest-distribution: + type: git + url: https://github.com/google/googletest.git + version: release-1.11.0 diff --git a/.github/workflows/fastcdr-test.yml b/.github/workflows/fastcdr-test.yml deleted file mode 100644 index f8b35977..00000000 --- a/.github/workflows/fastcdr-test.yml +++ /dev/null @@ -1,131 +0,0 @@ -# CI for Fast CDR repository -# The Action is triggered with a PR or push and every night at 00:00 -# Additionally, it can be also triggered manually - -name: Fast-CDR-test - -on: - - schedule: - - cron: '0 0 * * *' - - push: - branches: - - master - - 1.0.x - - 1.1.x - - workflow_dispatch: - inputs: - cmake_args: - description: 'Optional CMake arguments' - required: false - type: string - default: '' - ctest_args: - description: 'Optional CTest arguments' - required: false - type: string - default: '' - - pull_request: - branches: - - master - - 1.0.x - - 1.1.x - paths-ignore: - - '**.md' - - '**.txt' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - build-and-test: - name: Colcon build and test - - if: ${{ !(contains(github.event.pull_request.labels.*.name, 'no-test') || - contains(github.event.pull_request.labels.*.name, 'skip-ci')) }} - - runs-on: ${{ matrix.runner-image }} - strategy: - fail-fast: false - matrix: - runner-image: - - 'ubuntu-20.04' - - 'ubuntu-22.04' - - 'windows-2019' - - steps: - - name: Sync eProsima/Fast-CDR repository - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - path: src/Fast-CDR - - - name: Get minimum supported version of CMake - uses: eProsima/eProsima-CI/external/get-cmake@v0 - with: - cmakeVersion: '3.16.3' - - - name: Install Colcon dependencies - uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0 - - # Temporal step as this platform will be discontinued soon - - name: Install Gtest Backwards Compatibility - if: ${{ matrix.runner-image == 'ubuntu-20.04' }} - run: | - git clone --branch release-1.12.1 https://github.com/google/googletest.git && \ - colcon build \ - --event-handlers=console_direct+ \ - --packages-select googletest-distribution - - - name: Install Gtest - if: ${{ matrix.runner-image != 'ubuntu-20.04' }} - uses: eProsima/eProsima-CI/multiplatform/install_gtest@v0 - - - name: Colcon build - uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 - with: - colcon_build_args_default: --event-handlers=console_direct+ - cmake_args: ${{ inputs.cmake_args }} - cmake_args_default: -DEPROSIMA_BUILD_TESTS=ON - cmake_build_type: RelWithDebInfo - workspace: ${{ github.workspace }} - - - name: Colcon test - id: test - uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 - with: - colcon_test_args_default: --event-handlers=console_direct+ --return-code-on-test-failure - ctest_args: ${{ inputs.ctest_args }} - ctest_args_default: --repeat until-pass:3 --timeout 300 - packages_names: fastcdr - workspace: ${{ github.workspace }} - - - name: Test summary - uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 - if: ${{ !cancelled() && !contains(github.event.pull_request.labels.*.name, 'no-test') }} - with: - junit_reports_dir: "${{ steps.test.outputs.ctest_results_path }}" - print_summary: 'True' - show_failed: 'True' - show_disabled: 'False' - show_skipped: 'False' - - - name: Test Report - uses: eProsima/eProsima-CI/external/test-reporter@v0 - if: ${{ !cancelled() && !contains(github.event.pull_request.labels.*.name, 'no-test') }} - with: - name: "Report: ${{ matrix.runner-image }}" - path: "${{ steps.test.outputs.ctest_results_path }}*.xml" - working-directory: 'src/Fast-CDR' - path-replace-backslashes: 'true' - list-tests: 'failed' - - - name: Archive Test Results - if: always() - uses: actions/upload-artifact@v1 - with: - name: test-results-${{ matrix.runner-image }} - path: log/latest_test/fastcdr diff --git a/.github/workflows/mac-ci.yml b/.github/workflows/mac-ci.yml new file mode 100644 index 00000000..9ea93930 --- /dev/null +++ b/.github/workflows/mac-ci.yml @@ -0,0 +1,59 @@ +name: Fast CDR Mac CI + +on: + workflow_dispatch: + inputs: + os-version: + description: 'OS version to run the workflow' + required: false + default: 'macos-13' + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastcdr-branch: + description: 'Branch or tag of Fast CDR repository' + type: string + required: true + run-tests: + description: 'Run test suite of Fast CDR' + required: false + type: boolean + default: true + + pull_request: + types: + - review_requested + paths-ignore: + - '**.md' + - '**.txt' + - '!**/CMakeLists.txt' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + mac-ci: + if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} + uses: ./.github/workflows/reusable-ci.yml + with: + # It would be desirable to have a matrix of macos OS for this job, but due to the issue opened in this ticket: + # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. + os-version: ${{ inputs.os-version || 'macos-13' }} + label: ${{ format('mac-ci-{0}', inputs.fastcdr-branch || github.ref) }} + colcon-args: ${{ inputs.colcon-args }} + cmake-args: ${{ inputs.cmake-args }} + ctest-args: ${{ inputs.ctest-args }} + fastcdr-branch: ${{ inputs.fastcdr-branch || github.ref }} + 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'))) }} diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml new file mode 100644 index 00000000..54c4132b --- /dev/null +++ b/.github/workflows/reusable-ci.yml @@ -0,0 +1,159 @@ +name: Fast CDR reusable CI workflow + +on: + workflow_call: + inputs: + os-version: + description: 'The OS image for the workflow' + required: false + default: 'ubuntu-22.04' + type: string + vs-toolset: + description: 'Windows Visual Studio toolset to use (only Windows)' + required: false + type: string + label: + description: 'ID associated to the workflow' + required: true + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastcdr-branch: + description: 'Branch or tag of Fast CDR repository' + required: true + type: string + run-build: + description: 'Build Fast CDR (CI skipped otherwise)' + required: false + type: boolean + default: true + run-tests: + description: 'Run test suite of Fast CDR' + required: false + type: boolean + default: true + use-ccache: + description: 'Use CCache to speed up the build' + required: false + type: boolean + default: false +env: + toolset: ${{ inputs.vs-toolset && format('-T {0}', inputs.vs-toolset) || '' }} + test-meta: ${{ inputs.os-version == 'windows-2019' && format('{0}/src/fastcdr/.github/workflows/config/build_test.meta', github.workspace) || format('{0}/src/fastcdr/.github/workflows/config/build.meta {0}/src/fastcdr/.github/workflows/config/test.meta', github.workspace) }} +defaults: + run: + shell: bash + +jobs: + fastcdr_test: + runs-on: ${{ inputs.os-version }} + if: ${{ inputs.run-build == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + + steps: + - name: Add ci-pending label if PR + if: ${{ github.event_name == 'pull_request' }} + uses: eProsima/eProsima-CI/external/add_labels@v0 + with: + labels: ci-pending + number: ${{ github.event.number }} + repo: eProsima/Fast-CDR + + - name: Sync eProsima/Fast-CDR repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: src/fastcdr + ref: ${{ inputs.fastcdr-branch }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install Colcon dependencies + uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0 + + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} + with: + api_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 + with: + packages: vcstool + upgrade: false + + - name: Fetch Fast DDS CI dependencies + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + with: + vcs_repos_file: ${{ github.workspace }}/src/fastcdr/.github/workflows/config/test.repos + destination_workspace: src + skip_existing: 'true' + + - name: Colcon build + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastcdr/.github/workflows/config/build.meta + colcon_build_args: ${{ inputs.colcon-args }} + colcon_build_args_default: --event-handlers=console_direct+ + cmake_args: ${{ inputs.cmake-args }} + cmake_args_default: ${{ env.toolset }} + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Prepare build test meta file + if: ${{ inputs.run-tests == true && inputs.os-version == 'windows-2019' }} + uses: eProsima/eProsima-CI/windows/merge_yaml_metas@v0 + with: + metas: "@('${{ github.workspace }}/src/fastcdr/.github/workflows/config/build.meta', '${{ github.workspace }}/src/fastcdr/.github/workflows/config/test.meta')" + path: '${{ github.workspace }}/src/fastcdr/.github/workflows/config/build_test.meta' + + - name: Colcon test + id: test_fastcdr + if: ${{ inputs.run-tests == true }} + uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 + with: + colcon_meta_file: ${{ env.test-meta }} + colcon_test_args_default: --event-handlers=console_direct+ + ctest_args: ${{ inputs.ctest-args }} + packages_names: fastcdr + workspace: ${{ github.workspace }} + test_report_artifact: ${{ inputs.label }} + + - name: Fast CDR Test summary + uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 + if: ${{ !cancelled() && inputs.run-tests == true }} + with: + junit_reports_dir: ${{ steps.test_fastcdr.outputs.ctest_results_path }} + print_summary: 'True' + show_failed: 'True' + show_disabled: 'False' + show_skipped: 'False' + + - name: Archive Test Results + if: always() + uses: eProsima/eProsima-CI/external/upload-artifact@v0 + with: + name: test-results-${{ inputs.label }} + path: log/latest_test/fastcdr diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml new file mode 100644 index 00000000..5d133e18 --- /dev/null +++ b/.github/workflows/ubuntu-ci.yml @@ -0,0 +1,65 @@ +name: Fast CDR Ubuntu CI + +on: + workflow_dispatch: + inputs: + os-version: + description: 'OS version to run the workflow' + required: false + default: 'ubuntu-22.04' + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastcdr-branch: + description: 'Branch or tag of Fast CDR repository' + type: string + required: true + run-tests: + description: 'Run test suite of Fast CDR' + required: false + type: boolean + default: true + use-ccache: + description: 'Use CCache to speed up the build' + required: false + type: boolean + default: false + + pull_request: + types: + - review_requested + paths-ignore: + - '**.md' + - '**.txt' + - '!**/CMakeLists.txt' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + ubuntu-ci: + if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} + uses: ./.github/workflows/reusable-ci.yml + with: + # It would be desirable to have a matrix of ubuntu OS for this job, but due to the issue opened in this ticket: + # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. + os-version: ${{ inputs.os-version || 'ubuntu-22.04' }} + label: ${{ format('ubuntu-ci-{0}', inputs.fastcdr-branch || github.ref) }} + colcon-args: ${{ inputs.colcon-args }} + cmake-args: ${{ inputs.cmake-args }} + ctest-args: ${{ inputs.ctest-args }} + fastcdr-branch: ${{ inputs.fastcdr-branch || github.ref }} + 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'))) }} + use-ccache: ${{ inputs.use-ccache || false }} diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml new file mode 100644 index 00000000..761a5430 --- /dev/null +++ b/.github/workflows/windows-ci.yml @@ -0,0 +1,71 @@ +name: Fast CDR Windows CI + +on: + workflow_dispatch: + inputs: + os-version: + description: 'OS version to run the workflow' + required: false + default: 'windows-13' + type: string + vs-toolset: + description: 'Visual Studio toolset to use' + required: false + default: 'v142' + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastcdr-branch: + description: 'Branch or tag of Fast CDR repository' + type: string + required: true + run-tests: + description: 'Run test suite of Fast CDR' + required: false + type: boolean + default: true + + pull_request: + types: + - review_requested + paths-ignore: + - '**.md' + - '**.txt' + - '!**/CMakeLists.txt' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + windows-ci: + strategy: + fail-fast: false + matrix: + vs-toolset: + - 'v141' + - 'v142' + if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} + uses: ./.github/workflows/reusable-ci.yml + with: + # It would be desirable to have a matrix of windows OS for this job, but due to the issue opened in this ticket: + # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. + os-version: ${{ inputs.os-version || 'windows-2019' }} + vs-toolset: ${{ inputs.vs-toolset || matrix.vs-toolset }} + label: ${{ format('windows-{0}-ci-{1}', matrix.vs-toolset, inputs.fastcdr-branch || github.ref) }} + colcon-args: ${{ inputs.colcon-args }} + cmake-args: ${{ inputs.cmake-args }} + ctest-args: ${{ inputs.ctest-args }} + fastcdr-branch: ${{ inputs.fastcdr-branch || github.ref }} + 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'))) }} diff --git a/README.md b/README.md index 4d817f84..49a9aa6f 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ [![Issues](https://img.shields.io/github/issues/eProsima/Fast-CDR.svg)](https://github.com/eProsima/Fast-CDR/issues) [![Forks](https://img.shields.io/github/forks/eProsima/Fast-CDR.svg)](https://github.com/eProsima/Fast-CDR/network/members) [![Stars](https://img.shields.io/github/stars/eProsima/Fast-CDR.svg)](https://github.com/eProsima/Fast-CDR/stargazers) -[![Linux ci](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_linux/badge/icon?subject=%20%20%20Linux%20CI%20)](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_linux) +[![Fast CDR Ubuntu CI (nightly)](https://github.com/eProsima/Fast-CDR/actions/workflows/nightly-ubuntu-ci.yml/badge.svg)](https://github.com/eProsima/Fast-CDR/actions/workflows/nightly-ubuntu-ci.yml) [![Linux arm64 ci](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_linux_aarch64/badge/icon?subject=%20%20%20Linux-aarch64%20CI%20)](http://jenkins.eprosima.com:8080/view/Nightly/job/nightly_fastcdr_master_linux_aarch64/) -[![Windows ci](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_windows/label=windows-secure,platform=x64,toolset=v141/badge/icon?subject=%20%20%20%20Windows%20CI%20)](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_windows/label=windows-secure,platform=x64,toolset=v141) -[![Mac ci](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_mac/badge/icon?subject=%20%20%20%20%20%20%20Mac%20CI%20)](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_master_mac) +[![Fast CDR Windows CI (nightly)](https://github.com/eProsima/Fast-CDR/actions/workflows/nightly-windows-ci.yml/badge.svg)](https://github.com/eProsima/Fast-CDR/actions/workflows/nightly-windows-ci.yml) +[![Fast CDR MacOS CI (nightly)](https://github.com/eProsima/Fast-CDR/actions/workflows/nightly-mac-ci.yml/badge.svg)](https://github.com/eProsima/Fast-CDR/actions/workflows/nightly-mac-ci.yml) [![Coverage](https://img.shields.io/jenkins/coverage/cobertura.svg?jobUrl=http%3A%2F%2Fjenkins.eprosima.com%3A8080%2Fjob%2Fnightly_fastcdr_coverage_linux)](http://jenkins.eprosima.com:8080/job/nightly_fastcdr_coverage_linux) **eProsima Fast CDR** is a C++ library that provides two serialization mechanisms. diff --git a/RELEASE_SUPPORT.md b/RELEASE_SUPPORT.md new file mode 100644 index 00000000..6821b29b --- /dev/null +++ b/RELEASE_SUPPORT.md @@ -0,0 +1,6 @@ +# Release support + + +Please, refer to the [master branch](https://github.com/eProsima/Fast-CDR/blob/master/RELEASE_SUPPORT.md) for the latest version of this document. + +For detailed information about the lifecycle of the different *Fast DDS* versions (and their corresponding counterpart in this repository), please refer to the [release support section of the Fast DDS repository](https://github.com/eProsima/Fast-DDS/blob/master/RELEASE_SUPPORT.md).