Skip to content

Commit

Permalink
wip: can we put clippy in this action?
Browse files Browse the repository at this point in the history
  • Loading branch information
alphastrata committed Oct 9, 2023
1 parent 9a90d9c commit ecfd935
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Rust

on:
push:
branches: [ "main" ]
branches: [ "dev" ]
pull_request:
branches: [ "main" ]

Expand All @@ -20,3 +20,14 @@ jobs:
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

- name: Check for Clippy Warnings
run: |
# Run Clippy and capture its output
CLIPPY_OUTPUT=$(cargo clippy --message-format json)
# Check if Clippy produced any warnings
if echo "$CLIPPY_OUTPUT" | jq -e '.reason | contains("warning")' > /dev/null; then
echo "Clippy warnings found. This pull request will be denied."
exit 1 # Set the workflow status to failed
fi

0 comments on commit ecfd935

Please sign in to comment.