Skip to content

Merge pull request #110 from EiJackGH/palette/mario-game-scrolling-fi… #92

Merge pull request #110 from EiJackGH/palette/mario-game-scrolling-fi…

Merge pull request #110 from EiJackGH/palette/mario-game-scrolling-fi… #92

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
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