forked from herocode/horus
limit rust checks/builds to bin crates only Run cargo check/test/clippy/build only for crates under bin/ using --manifest-path instead of the full workspace. This avoids unrelated validating all binaries.
This commit is contained in:
@@ -46,20 +46,45 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-build-target-
|
${{ runner.os }}-cargo-build-target-
|
||||||
|
|
||||||
- name: Check code
|
# 🔍 Check only crates under bin/
|
||||||
run: cargo check --workspace --verbose
|
- name: Check code (all crates under bin/)
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
find bin -name Cargo.toml -print0 | while IFS= read -r -d '' manifest; do
|
||||||
|
echo "=== cargo check --manifest-path $manifest ==="
|
||||||
|
cargo check --manifest-path "$manifest" --verbose
|
||||||
|
done
|
||||||
|
|
||||||
- name: Run tests
|
# ✅ Run tests only for crates under bin/
|
||||||
run: cargo test --workspace --verbose
|
- name: Run tests (all crates under bin/)
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
find bin -name Cargo.toml -print0 | while IFS= read -r -d '' manifest; do
|
||||||
|
echo "=== cargo test --manifest-path $manifest ==="
|
||||||
|
cargo test --manifest-path "$manifest" --verbose
|
||||||
|
done
|
||||||
|
|
||||||
- name: Run clippy
|
# 🧹 Clippy only for crates under bin/
|
||||||
run: cargo clippy --workspace -- -D warnings
|
- name: Run clippy (all crates under bin/)
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
find bin -name Cargo.toml -print0 | while IFS= read -r -d '' manifest; do
|
||||||
|
echo "=== cargo clippy --manifest-path $manifest ==="
|
||||||
|
cargo clippy --manifest-path "$manifest" -- -D warnings
|
||||||
|
done
|
||||||
|
|
||||||
|
# Formatting can safely stay workspace-wide
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
run: cargo fmt --all -- --check
|
run: cargo fmt --all -- --check
|
||||||
|
|
||||||
- name: Build release binaries
|
# 🏗 Build release binaries only for crates under bin/
|
||||||
run: cargo build --workspace --release --verbose
|
- name: Build release binaries (all crates under bin/)
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
find bin -name Cargo.toml -print0 | while IFS= read -r -d '' manifest; do
|
||||||
|
echo "=== cargo build --manifest-path $manifest --release ==="
|
||||||
|
cargo build --manifest-path "$manifest" --release --verbose
|
||||||
|
done
|
||||||
|
|
||||||
- name: List built binaries
|
- name: List built binaries
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user