From 0fed0e14ceec418837a0f1795c32ff10124e15d2 Mon Sep 17 00:00:00 2001 From: "Tom G. Huang" Date: Sat, 21 Jun 2025 17:38:32 -0700 Subject: [PATCH] build: add valgrind ci workflow for memory issue detection This commit introduces a GitHub Actions workflow (`valgrind.yml`) to detect memory issues in the `argtable3` project using Valgrind. The workflow runs on `push` and `pull_request` events targeting the `master` branch, as well as manually via `workflow_dispatch`. Purpose: - Use Valgrind to identify memory leaks and invalid memory accesses. - Automate memory issue detection during CI to improve code quality. --- .github/workflows/valgrind.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/valgrind.yml diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml new file mode 100644 index 0000000..3409e7d --- /dev/null +++ b/.github/workflows/valgrind.yml @@ -0,0 +1,33 @@ +name: Valgrind + +on: + workflow_dispatch: + push: + branches: [ master ] + pull_request: + +jobs: + valgrind-check: + name: Valgrind Memory Check + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential cmake valgrind + + - name: Build Project + run: | + mkdir -p build + cd build + cmake -DCMAKE_BUILD_TYPE=Debug .. + make + + - name: Run Tests with Valgrind + run: | + cd build + valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1 tests/test_src