cargo-outdated 0.18.0

Cargo subcommand for displaying when dependencies are out of date
name: Lint

on:
  pull_request:
    branches: [master, main]
  push:
    branches: [staging, trying]

concurrency:
  group: lint-${{ github.ref }}
  cancel-in-progress: true

jobs:
  ci:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust:
          - nightly
          - 1.84.0 # MSRV
          - stable

    steps:
      - uses: actions/checkout@v5

      - name: Remove rust-toolchain.toml
        # contains nightly & linters/formatters
        run: rm -f rust-toolchain.toml

      - name: OpenSSL Libs
        if: matrix.os == 'ubuntu-latest' && matrix.features == 'all'
        run: |
          sudo apt-get update
          sudo apt-get install libssl-dev

      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
          components: clippy, rustfmt

      - uses: Swatinem/rust-cache@v2

      - name: Spell Check
        uses: crate-ci/typos@master

      - name: Install Just
        if: ${{ matrix.rust == 'nightly' || matrix.rust == 'stable' }}
        run: cargo install just

      - name: Check Formatting
        if: ${{ matrix.rust == 'nightly' }}
        run: |
          just fmt-check

      - name: Clippy
        if: ${{ matrix.rust == 'stable' }}
        run: |
          cargo clippy --all-targets -- -Dwarnings
          cargo clippy --all-targets --no-default-features -- -Dwarnings
          cargo clippy --all-targets --all-features -- -Dwarnings

      - name: MSRV Check
        if: ${{ matrix.rust == '1.84.0' }}
        # Note we have to actually _run_ the application to check the MSRV.
        # The standard `cargo check` may successfully build on an earlier
        # Rust, but cargo-oudated by not be able to successfully run in such
        # environments.
        #
        # Note2: we exclude git2-curl because it requires libgit2-sys which
        # must match the same version that our internal cargo transitively
        # requires
        run: cargo run -- outdated -x git2-curl