Skip to content

Commit 1dbe921

Browse files
committed
fix: make CI workflow cross-platform compatible
- Replace bash conditionals with continue-on-error approach - Add separate feedback steps that work on Windows PowerShell - Include reference to fix-code-quality.sh script in error messages - Ensure compatibility across ubuntu, windows, and macos runners
1 parent 73da265 commit 1dbe921

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,33 @@ jobs:
4343
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
4444

4545
- name: Check formatting
46+
run: cargo fmt --all -- --check
47+
continue-on-error: true
48+
id: fmt-check
49+
50+
- name: Formatting feedback
51+
if: steps.fmt-check.outcome == 'failure'
4652
run: |
47-
if ! cargo fmt --all -- --check; then
48-
echo "❌ Code formatting issues detected!"
49-
echo "Please run 'cargo fmt --all' to fix formatting."
50-
echo "Or add this to your pre-commit hook:"
51-
echo " cargo fmt --all"
52-
exit 1
53-
fi
53+
echo "❌ Code formatting issues detected!"
54+
echo "Please run 'cargo fmt --all' to fix formatting."
55+
echo "Or add this to your pre-commit hook:"
56+
echo " cargo fmt --all"
57+
exit 1
5458
5559
- name: Run clippy
60+
run: cargo clippy --all-targets --all-features -- -D warnings
61+
continue-on-error: true
62+
id: clippy-check
63+
64+
- name: Clippy feedback
65+
if: steps.clippy-check.outcome == 'failure'
5666
run: |
57-
if ! cargo clippy --all-targets --all-features -- -D warnings; then
58-
echo "❌ Clippy issues detected!"
59-
echo "Please run 'cargo clippy --all-targets --all-features --fix --allow-dirty' to fix issues."
60-
echo "Or add this to your development workflow:"
61-
echo " cargo clippy --fix --allow-dirty"
62-
exit 1
63-
fi
67+
echo "❌ Clippy issues detected!"
68+
echo "Please run 'cargo clippy --all-targets --all-features --fix --allow-dirty' to fix issues."
69+
echo "Or add this to your development workflow:"
70+
echo " cargo clippy --fix --allow-dirty"
71+
echo "Or run './scripts/fix-code-quality.sh' to auto-fix both formatting and clippy issues."
72+
exit 1
6473
6574
- name: Build
6675
run: cargo build --verbose

0 commit comments

Comments
 (0)