diff --git a/.github/scripts/check_lockbud.sh b/.github/scripts/check_lockbud.sh new file mode 100755 index 000000000..ca6af6c7a --- /dev/null +++ b/.github/scripts/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 diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 994ba3dab..b3c6e8859 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -213,3 +213,16 @@ jobs: bins: cargo-sort, taplo-cli - name: Run cargo sort to check if Cargo.toml files are sorted run: make sort + + lockbud: + name: lockbud + runs-on: ubuntu-latest + container: + image: sigmaprime/lockbud:latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install dependencies + run: apt update && apt install -y cmake libclang-dev + - name: Check for deadlocks + run: .github/scripts/check_lockbud.sh