From 56f201a257e86d0aeacc6072da11d08e8c7abc63 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Tue, 4 Feb 2025 05:00:37 +0300 Subject: [PATCH] Add check to Lockbud CI job (#6898) --- .github/workflows/test-suite.yml | 3 +-- scripts/ci/check-lockbud.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100755 scripts/ci/check-lockbud.sh diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 0ee9dbb622..0f91c86617 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -65,8 +65,7 @@ jobs: - name: Install dependencies run: apt update && apt install -y cmake libclang-dev - name: Check for deadlocks - run: | - cargo lockbud -k deadlock -b -l tokio_util + run: ./scripts/ci/check-lockbud.sh target-branch-check: name: target-branch-check diff --git a/scripts/ci/check-lockbud.sh b/scripts/ci/check-lockbud.sh new file mode 100755 index 0000000000..8e1d33b53b --- /dev/null +++ b/scripts/ci/check-lockbud.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Run lockbud to check for deadlocks and capture the output +output=$(cargo lockbud -k deadlock -b -l tokio_util 2>&1) + +# Check if lockbud returned any issues +if echo "$output" | grep -q '"bug_kind"'; then + # Print the JSON payload + echo "Lockbud detected issues:" + echo "$output" + + # Exit with a non-zero status to indicate an error + exit 1 +else + echo "No issues detected by Lockbud." + exit 0 +fi \ No newline at end of file