diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..c815ecc --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,45 @@ +name: Rust CI/CD + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + name: Build and Test + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: x86_64-unknown-linux-gnu + profile: minimal + override: true + + - name: Install Dependencies + run: rustup component add clippy rustfmt + + - name: Run Clippy (Linting) + run: cargo clippy --all-targets --all-features -- -D warnings + + - name: Run Tests + run: cargo test --all-targets --all-features --verbose + + - name: Build Project + run: cargo build --release + + - name: Upload Build Artifacts + if: always() + uses: actions/upload-artifact@v3 + with: + name: hrv-rs-build + path: target/release/