Bump Cargo.lock (#342) #893
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: lint | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| workflow_call: | |
| concurrency: | |
| group: lint-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| FORCE_COLOR: "1" | |
| PYTHONUNBUFFERED: "1" | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d | |
| with: | |
| activate-environment: true | |
| enable-cache: true | |
| # HACK: there's a bug in either `astral-sh/setup-uv` or pre-commit-uv or both | |
| # because uv gets installed to `/opt/hostedtoolcache/uv/<version>/x86_64/uv` | |
| # and pre-commit-uv apparently only looks for it at `~/.local/bin/uv` | |
| - run: | | |
| mkdir -p ~/.local/bin | |
| ln -sf $(which uv) ~/.local/bin/uv | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pre-commit/ | |
| key: pre-commit-1|${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Run pre-commit | |
| run: | | |
| SKIP=no-commit-to-branch \ | |
| uv run --no-project --with "nox[uv]" nox --session lint | |
| rust-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| rust: ${{ steps.filter.outputs.rust }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
| id: filter | |
| with: | |
| filters: | | |
| rust: | |
| - '.github/workflows/lint.yml' | |
| - 'crates/**' | |
| - 'Cargo.lock' | |
| - 'Cargo.toml' | |
| rustfmt: | |
| runs-on: ubuntu-24.04 | |
| needs: rust-changes | |
| if: needs.rust-changes.outputs.rust == 'true' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Cache rustup toolchain | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.rustup | |
| key: ${{ runner.os }}-${{ runner.arch }}-rustup-nightly-${{ hashFiles('.github/workflows/lint.yml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-rustup-nightly- | |
| - name: Cache Cargo dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/git | |
| ~/.cargo/registry | |
| key: ${{ runner.os }}-${{ runner.arch }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-cargo-registry- | |
| ${{ runner.os }}-cargo-registry- | |
| - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c | |
| with: | |
| toolchain: nightly | |
| components: rustfmt | |
| - name: Run rustfmt | |
| run: cargo +nightly fmt --all -- --check | |
| clippy: | |
| runs-on: ubuntu-24.04 | |
| needs: rust-changes | |
| if: needs.rust-changes.outputs.rust == 'true' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Cache rustup toolchain | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.rustup | |
| key: ${{ runner.os }}-${{ runner.arch }}-rustup-${{ hashFiles('rust-toolchain.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-rustup- | |
| - name: Cache Cargo dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/git | |
| ~/.cargo/registry | |
| key: ${{ runner.os }}-${{ runner.arch }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-cargo-registry- | |
| ${{ runner.os }}-cargo-registry- | |
| - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c | |
| with: | |
| components: clippy | |
| - name: Run clippy | |
| run: cargo clippy --all-targets --all-features --benches -- -D warnings | |
| cargo-check: | |
| runs-on: ubuntu-24.04 | |
| needs: rust-changes | |
| if: needs.rust-changes.outputs.rust == 'true' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Cache rustup toolchain | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.rustup | |
| key: ${{ runner.os }}-${{ runner.arch }}-rustup-${{ hashFiles('rust-toolchain.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-rustup- | |
| - name: Cache Cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/git | |
| ~/.cargo/registry | |
| key: ${{ runner.os }}-${{ runner.arch }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-cargo-registry- | |
| ${{ runner.os }}-cargo-registry- | |
| - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c | |
| - name: Run cargo check | |
| run: cargo check --all-targets --all-features |