From 7afe488a608454bb7d7beaa2f9a6e8de7dff42bf Mon Sep 17 00:00:00 2001 From: aiekick Date: Thu, 1 Feb 2024 20:26:43 +0100 Subject: [PATCH] [ADD] : add the leak detector in a particular github/actions workflow file --- .github/workflows/Leak.yml | 79 +++++++++++++++++++++++++++++++++++++ .github/workflows/Linux.yml | 6 +-- CMakeLists.txt | 4 +- 3 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/Leak.yml diff --git a/.github/workflows/Leak.yml b/.github/workflows/Leak.yml new file mode 100644 index 0000000..2e76b71 --- /dev/null +++ b/.github/workflows/Leak.yml @@ -0,0 +1,79 @@ +name: Leak + +on: + push: + branches: + - DemoApp + paths-ignore: + - 'cmake/**' + - '.github/**' + - 'doc/**' + - 'samples/**' + +jobs: + App_Linux_Dirent_FS: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: DemoApp + - name: checkout submodules + run : git submodule update --init --recursive + - name: Install OpenGL lib / Requirement for Glfw3 + run : sudo apt-get update && sudo apt-get install libgl1-mesa-dev libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev + - name: configure + run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_LEAK_SANITIZER=ON + - name: build + run: cmake --build build --config Release + - name: ctest + run: ctest --test-dir build --output-on-failure + - name: upload artifact + uses: actions/upload-artifact@v3 + with: + name: ImGuiFileDialog_App_Unix_Dirent_FS + path: build/ImGuiFileDialog_App_Unix + + App_Linux_Std_FS: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: DemoApp + - name: checkout submodules + run : git submodule update --init --recursive + - name: Install OpenGL lib / Requirement for Glfw3 + run : sudo apt-get update && sudo apt-get install libgl1-mesa-dev libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev + - name: configure + run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_STD_FILESYSTEM=ON -DUSE_LEAK_SANITIZER=ON + - name: build + run: cmake --build build --config Release + - name: ctest + run: ctest --test-dir build --output-on-failure + - name: upload artifact + uses: actions/upload-artifact@v3 + with: + name: ImGuiFileDialog_App_Unix_Std_FS + path: build/ImGuiFileDialog_App_Unix + + App_Linux_Boost_FS: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: DemoApp + - name: checkout submodules + run : git submodule update --init --recursive + - name: Install OpenGL lib / Requirement for Glfw3 + run : sudo apt-get update && sudo apt-get install libgl1-mesa-dev libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev + - name: configure + run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_BOOST_DEMO_FILESYSTEM=ON -DUSE_LEAK_SANITIZER=ON + - name: build + run: cmake --build build --config Release + - name: ctest + run: ctest --test-dir build --output-on-failure + - name: upload artifact + uses: actions/upload-artifact@v3 + with: + name: ImGuiFileDialog_App_Unix_Boost_FS + path: build/ImGuiFileDialog_App_Unix + diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml index 657e40b..9b5b625 100644 --- a/.github/workflows/Linux.yml +++ b/.github/workflows/Linux.yml @@ -22,7 +22,7 @@ jobs: - name: Install OpenGL lib / Requirement for Glfw3 run : sudo apt-get update && sudo apt-get install libgl1-mesa-dev libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev - name: configure - run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_LEAK_SANITIZER=ON + run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON - name: build run: cmake --build build --config Release - name: ctest @@ -44,7 +44,7 @@ jobs: - name: Install OpenGL lib / Requirement for Glfw3 run : sudo apt-get update && sudo apt-get install libgl1-mesa-dev libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev - name: configure - run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_STD_FILESYSTEM=ON -DUSE_LEAK_SANITIZER=ON + run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_STD_FILESYSTEM=ON - name: build run: cmake --build build --config Release - name: ctest @@ -66,7 +66,7 @@ jobs: - name: Install OpenGL lib / Requirement for Glfw3 run : sudo apt-get update && sudo apt-get install libgl1-mesa-dev libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev - name: configure - run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_BOOST_DEMO_FILESYSTEM=ON -DUSE_LEAK_SANITIZER=ON + run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_TEST=ON -DUSE_BOOST_DEMO_FILESYSTEM=ON - name: build run: cmake --build build --config Release - name: ctest diff --git a/CMakeLists.txt b/CMakeLists.txt index 59a782d..a56704b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,8 +90,8 @@ if (USE_TEST) endif() if (USE_LEAK_SANITIZER) - add_compile_options(-fexceptions -pthread -ldl -lGL -Wall -Werror -g -fsanitize=undefined -fno-sanitize-recover -fsanitize=float-cast-overflow -fsanitize=leak -fsanitize=address -fsanitize-address-use-after-scope -fstack-protector -fstack-protector-all -fstack-check) - add_link_options(-fexceptions -pthread -ldl -lGL -Wall -Werror -g -fsanitize=undefined -fno-sanitize-recover -fsanitize=float-cast-overflow -fsanitize=leak -fsanitize=address -fsanitize-address-use-after-scope -fstack-protector -fstack-protector-all -fstack-check) + add_compile_options(-fexceptions -pthread -ldl -lGL -Wall -g -fsanitize=undefined -fno-sanitize-recover -fsanitize=float-cast-overflow -fsanitize=leak -fsanitize=address -fsanitize-address-use-after-scope -fstack-protector -fstack-protector-all) + add_link_options(-fexceptions -pthread -ldl -lGL -Wall -g -fsanitize=undefined -fno-sanitize-recover -fsanitize=float-cast-overflow -fsanitize=leak -fsanitize=address -fsanitize-address-use-after-scope -fstack-protector -fstack-protector-all) endif() add_subdirectory(${CMAKE_SOURCE_DIR}/ImGuiFileDialog)