Add check to Lockbud CI job (#6898)

This commit is contained in:
Eitan Seri-Levi
2025-02-04 05:00:37 +03:00
committed by GitHub
parent d1061dcf59
commit 56f201a257
2 changed files with 18 additions and 2 deletions

View File

@@ -65,8 +65,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: apt update && apt install -y cmake libclang-dev run: apt update && apt install -y cmake libclang-dev
- name: Check for deadlocks - name: Check for deadlocks
run: | run: ./scripts/ci/check-lockbud.sh
cargo lockbud -k deadlock -b -l tokio_util
target-branch-check: target-branch-check:
name: target-branch-check name: target-branch-check

17
scripts/ci/check-lockbud.sh Executable file
View File

@@ -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