Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,23 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Check for Rust projects
id: check_rust
run: |
if [ -f "Cargo.toml" ] && ([ -f "src/main.rs" ] || [ -f "src/lib.rs" ]); then
echo "has_rust=true" >> $GITHUB_OUTPUT
else
echo "has_rust=false" >> $GITHUB_OUTPUT
echo "No valid Rust project (Cargo.toml + src/main.rs or src/lib.rs) found. Rust steps will be skipped."
echo "### 🦀 Rust Build Skip" >> $GITHUB_STEP_SUMMARY
echo "No valid Rust project found in the root directory. Rust build and test steps were skipped to prevent CI failure (Exit Code 101)." >> $GITHUB_STEP_SUMMARY
fi

- name: Build
if: steps.check_rust.outputs.has_rust == 'true'
run: cargo build --verbose

- name: Run tests
if: steps.check_rust.outputs.has_rust == 'true'
run: cargo test --verbose