From 470ff3f24672b3e6ca2b10b2e81714a99dfb21e3 Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Tue, 28 Nov 2023 12:12:34 -0800 Subject: [PATCH] Setup Valgrind on GHA [skip ci] --- .github/workflows/macos.yml | 20 +++++++------- .github/workflows/valgrind.yml | 50 ++++++++++++++++++++++++++++++++++ CMakePresets.json | 14 ++++++++++ 3 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/valgrind.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 74efce51b..cdc078628 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -18,16 +18,16 @@ jobs: - name: Setup run: | - rm /usr/local/bin/2to3 - rm /usr/local/bin/2to3-3.11 - rm /usr/local/bin/idle3 - rm /usr/local/bin/idle3.11 - rm /usr/local/bin/pydoc3 - rm /usr/local/bin/pydoc3.11 - rm /usr/local/bin/python3 - rm /usr/local/bin/python3.11 - rm /usr/local/bin/python3-config - rm /usr/local/bin/python3.11-config +# rm /usr/local/bin/2to3 +# rm /usr/local/bin/2to3-3.11 +# rm /usr/local/bin/idle3 +# rm /usr/local/bin/idle3.11 +# rm /usr/local/bin/pydoc3 +# rm /usr/local/bin/pydoc3.11 +# rm /usr/local/bin/python3 +# rm /usr/local/bin/python3.11 +# rm /usr/local/bin/python3-config +# rm /usr/local/bin/python3.11-config brew install automake autoconf autoconf-archive libtool texinfo yasm ninja python ccache pkg-config - name: Restore artifacts or setup vcpkg diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml new file mode 100644 index 000000000..65502d84c --- /dev/null +++ b/.github/workflows/valgrind.yml @@ -0,0 +1,50 @@ +name: Valgrind + +on: [workflow_dispatch] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: true + + - name: Setup + run: | + sudo apt update + sudo apt-get install build-essential automake autoconf autoconf-archive texinfo libtool-bin yasm ninja-build ccache + + - name: Setup GCC + uses: pkgxdev/setup@v1 + with: + +: gcc@13 + + - run: gcc --version + + - name: Restore artifacts or setup vcpkg + uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: 2a01db703fec3cdd13ca884a6a84d1505df2d235 + + - name: Configure + run: cmake --preset=valgrind + + - name: Build + run: cmake --build build -j 2 + + - name: Run Valgrind + working-directory: build + continue-on-error: true + run: | + ctest -VV -T memcheck --verbose + cd src + valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose ./initialize --s n32000 -t11 -o + valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose ./cdt-opt + valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose ./cdt --s -n64 -t3 -a.6 -k1.1 -l.1 -p10 \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json index 562a1a767..e4ab5f484 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -122,6 +122,20 @@ "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" } }, + { + "name": "valgrind", + "inherits": "ci-std", + "description": "This preset is used for valgrind builds", + "generator": "Ninja", + "cacheVariables": { + "CMAKE_C_COMPILER": "gcc", + "CMAKE_CXX_COMPILER": "g++", + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "ENABLE_VALGRIND": true, + "ENABLE_TESTING": true, + "ENABLE_CACHE": "OFF" + } + }, { "name": "conf-common", "description": "General settings that apply to all configurations",