diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..d1f3507 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,40 @@ +name: Rust CI + +on: + push: + branches: ['**'] + pull_request: + branches: ['**'] + +env: + CARGO_TERM_COLOR: always + +jobs: + build_and_test: + name: Build and Test + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set Up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy, rustfmt + override: true + + - name: Cache Cargo Dependencies + uses: Swatinem/rust-cache@v2 + + - name: Check Code Formatting + run: cargo fmt --all -- --check + + - name: Run Clippy (Linter) + run: cargo clippy --all-targets --all-features -- -D warnings + + - name: Build Project + run: cargo build --verbose + + - name: Run Tests + run: cargo test --verbose