Skip to content

Commit

Permalink
[20542] Pin CMake version and vm.mmap_rnd_bits in sanitizer workflows (
Browse files Browse the repository at this point in the history
…#4558)

* Refs #20542: Fix CMake version in sanitizer workflows

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20542: Install correct version of Gtest

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* fixup! Refs #20542: Fix CMake version in sanitizer workflows

* Refs #20542: Set number of random bits for mmap to 28

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20542: Fix asan_colcon.meta

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20542: Use CCache also for ASan DS

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz authored Mar 15, 2024
1 parent 276581e commit 0c439a0
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 14 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/address-sanitizers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
- '**.md'
- '**.txt'
- '!**/CMakeLists.txt'

schedule:
- cron: '0 1 * * *'

Expand All @@ -40,11 +40,20 @@ jobs:
FASTDDS_BRANCH: ${{ github.head_ref || github.event.inputs.fastdds_branch || 'master' }}

steps:
# https://github.com/actions/runner-images/issues/9491
- name: Fix kernel mmap rnd bits
run: sudo sysctl vm.mmap_rnd_bits=28

- name: Install apt packages
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: curl grep libasio-dev libtinyxml2-dev python3 python3-pip software-properties-common wget

- name: Get minimum supported version of CMake
uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
cmakeVersion: '3.22.6'

- name: Setup CCache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0

Expand Down Expand Up @@ -75,10 +84,12 @@ jobs:
cd ./src/fastrtps
git checkout ${{ env.FASTDDS_BRANCH }}
- name: Install GTest
uses: eProsima/eProsima-CI/ubuntu/install_gtest@v0
- name: Fetch Fast DDS ASan dependencies
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
with:
version: v1.12.1
vcs_repos_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan.repos
destination_workspace: src
skip_existing: 'true'

- name: Build workspace
run: |
Expand Down Expand Up @@ -126,11 +137,23 @@ jobs:
DEFAULT_DISCOVERY_SERVER_BRANCH: ${{ github.event.inputs.discovery_server_branch || 'master' }}

steps:
# https://github.com/actions/runner-images/issues/9491
- name: Fix kernel mmap rnd bits
run: sudo sysctl vm.mmap_rnd_bits=28

- name: Install apt packages
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: curl grep libasio-dev libtinyxml2-dev python3 python3-pip software-properties-common wget

- name: Get minimum supported version of CMake
uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
cmakeVersion: '3.22.6'

- name: Setup CCache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0

- name: Install colcon
uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/config/asan.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repositories:
googletest-distribution:
type: git
url: https://github.com/google/googletest.git
version: release-1.12.1
11 changes: 8 additions & 3 deletions .github/workflows/config/asan_colcon.meta
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ names:
- "-DFASTDDS_STATISTICS=ON"
- "-DSANITIZER=Address"
- "-DCMAKE_CXX_FLAGS='-Werror'"

discovery-server:
cmake-args:
-"-DCMAKE_BUILD_TYPE=Debug"
-"-DSANITIZER=Address"
- "-DCMAKE_BUILD_TYPE=Debug"
- "-DSANITIZER=Address"
googletest-distribution:
cmake-args:
- "-Dgtest_force_shared_crt=ON"
- "-DBUILD_SHARED_LIBS=ON"
- "-DBUILD_GMOCK=ON"

5 changes: 5 additions & 0 deletions .github/workflows/config/tsan_colcon.meta
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ names:
- "-DFASTDDS_STATISTICS=ON"
- "-DCMAKE_C_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'"
- "-DCMAKE_CXX_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'"
googletest-distribution:
cmake-args:
- "-Dgtest_force_shared_crt=ON"
- "-DBUILD_SHARED_LIBS=ON"
- "-DBUILD_GMOCK=ON"
2 changes: 1 addition & 1 deletion .github/workflows/reusable-mac-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
python-version: '3.11'

- name: Get minimum supported version of CMake
uses: lukka/get-cmake@latest
uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
cmakeVersion: '3.22.6'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-ubuntu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
ref: ${{ inputs.fastdds-branch }}

- name: Get minimum supported version of CMake
uses: lukka/get-cmake@latest
uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
cmakeVersion: '3.22.6'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
ref: ${{ inputs.fastdds_branch }}

- name: Get minimum supported version of CMake
uses: lukka/get-cmake@latest
uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
cmakeVersion: '3.22.6'

Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/thread-sanitizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:

schedule:
- cron: '0 1 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand All @@ -50,11 +50,20 @@ jobs:
CXX: g++-12

steps:
# https://github.com/actions/runner-images/issues/9491
- name: Fix kernel mmap rnd bits
run: sudo sysctl vm.mmap_rnd_bits=28

- name: Install apt packages
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: curl grep libasio-dev libtinyxml2-dev python3 python3-pip software-properties-common wget

- name: Get minimum supported version of CMake
uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
cmakeVersion: '3.22.6'

- name: Setup CCache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0

Expand Down Expand Up @@ -85,10 +94,12 @@ jobs:
cd ./src/fastrtps
git checkout ${{ env.FASTDDS_BRANCH }}
- name: Install GTest
uses: eProsima/eProsima-CI/ubuntu/install_gtest@v0
- name: Fetch Fast DDS CI dependencies
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
with:
version: release-1.11.0
vcs_repos_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.repos
destination_workspace: src
skip_existing: 'true'

- name: Build workspace
run: |
Expand Down

0 comments on commit 0c439a0

Please sign in to comment.