name: Analyze on: push: branches: [ "*" ] pull_request: branches: [ "*" ] env: CARGO_TERM_COLOR: always jobs: # ========================== # Formatting # ========================== fmt: name: Fmt runs-on: ubuntu-latest permissions: contents: read steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install Rust toolchain (rustfmt only) uses: dtolnay/rust-toolchain@stable with: components: rustfmt - name: Check formatting run: cargo fmt -- --check # ========================== # Tests + Clippy + Udeps # ========================== test: name: Test / Clippy / Udeps runs-on: ubuntu-latest permissions: contents: read actions: write checks: write steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: components: 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: Run tests run: cargo test --verbose # clippy не валит билд (осознанно) - name: Run clippy run: cargo clippy -- --cap-lints warn - name: Install cargo-udeps run: cargo install cargo-udeps || true - name: Check for unused dependencies run: cargo udeps || true