From 493b3952a23b6548976ce56a2db5735d3947a95e Mon Sep 17 00:00:00 2001 From: "Tom G. Huang" Date: Sat, 21 Jun 2025 17:10:23 -0700 Subject: [PATCH] build: add asan memory check ci workflow This commit adds a GitHub Actions workflow (`asan.yml`) to detect memory issues in the `argtable3` project using AddressSanitizer (ASan). The workflow triggers on `push` and `pull_request` events targeting the `main` branch. It builds the project with ASan and runs tests to identify memory errors, including leaks and invalid accesses. Purpose: - Ensure memory safety by detecting issues during CI. - Improve code quality and reliability with automated checks. --- .github/workflows/asan.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/asan.yml diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml new file mode 100644 index 0000000..c1cdf58 --- /dev/null +++ b/.github/workflows/asan.yml @@ -0,0 +1,33 @@ +name: ASan + +on: + workflow_dispatch: + push: + branches: [ master ] + pull_request: + +jobs: + asan-check: + name: AddressSanitizer 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 + + - name: Build with ASan + run: | + mkdir -p build + cd build + cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer" .. + make + + - name: Run Tests + run: | + cd build + CTEST_OUTPUT_ON_FAILURE=1 make test