Skip to content

Commit

Permalink
Add lockbud to CI (#83)
Browse files Browse the repository at this point in the history
Co-authored-by: ThreeHrSleep <151536303+ThreeHrSleep@users.noreply.github.com>
Co-authored-by: jking-aus <72330194+jking-aus@users.noreply.github.com>
Co-authored-by: Daniel Knopik <daniel@dknopik.de>
Co-authored-by: Anton Hughes <kurrent93@gmail.com>
  • Loading branch information
5 people authored Jan 22, 2025
1 parent 49f69c0 commit a9c284a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/scripts/check_lockbud.sh
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a9c284a

Please sign in to comment.