name: Rust on: push: branches: [ main ] pull_request: branches: [ main ] env: CARGO_TERM_COLOR: always jobs: build-and-test: name: Build & Test runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install latest stable Rust toolchain uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy - name: Cache cargo registry & build artifacts uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo- - name: Check Format run: cargo fmt -- --check - name: Build Release run: cargo build --release --verbose - name: Run Tests run: cargo test --verbose - name: Run benchmarks (if any) if: always() run: cargo bench || true - name: Check for unused dependencies run: cargo udeps || true # - uses: dtolnay/rust-toolchain@stable # with: # toolchain: 1.76 # укажи свою MSRV из Cargo.toml # - run: cargo check --all-targets