From 602bfd9b3b6fd44853d28d9867849c06bbb3c8b8 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sun, 3 Dec 2023 17:47:17 +0200 Subject: [PATCH] Fix valgrinding (#405) --- .github/workflows/linux.yml | 6 ++++-- runtests.sh | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 8ef22f5e..e2b93d0e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -24,12 +24,14 @@ jobs: - run: LLVM_CONFIG=llvm-config-${{ matrix.llvm-version }} make - run: ./runtests.sh --verbose 'jou ${{ matrix.opt-level }} %s' - run: ./runtests.sh --verbose 'jou ${{ matrix.opt-level }} --verbose %s' - # Valgrinding is slow. Do it only when this file or something in the compiler has been modified. + # Valgrinding is slow, but many files affect valgrind resuls. + # We skip it when all changes are to .md files (docs, README etc) - name: Figure out if we need to run tests with valgrind id: check-need-valgrind run: | git fetch https://github.com/Akuli/jou main - if git diff --name-only FETCH_HEAD HEAD | grep -E '(\.c|\.h)$|^tests/'; then + # Find modified non-markdown files. If there are any, set doit=yes. + if git diff --name-only FETCH_HEAD HEAD | grep -vE '\.md$'; then echo doit=yes >> $GITHUB_OUTPUT else echo doit=no >> $GITHUB_OUTPUT diff --git a/runtests.sh b/runtests.sh index 5dc94585..14f81b85 100755 --- a/runtests.sh +++ b/runtests.sh @@ -45,7 +45,7 @@ else fi if [ $valgrind = yes ]; then - command_template="valgrind -q --leak-check=full --show-leak-kinds=all --suppressions=valgrind-suppressions.sup $command_template" + command_template="valgrind -q --leak-check=full --show-leak-kinds=all --suppressions='$(pwd)/valgrind-suppressions.sup' $command_template" fi if [ $run_make = yes ]; then