name: Lint

on:
  push:
    branches:
      - '**'
  pull_request:
    branches:
      - main
      - 'release/**'

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

env:
  CARGO_TERM_COLOR: always

jobs:
  lint:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy

      - name: Install dependencies
        run: |
          sudo apt-get update && sudo apt-get install -y make libfontconfig1-dev pkg-config

      - name: Lint
        run: make lint

      - name: Lint (strict — ban unwrap/expect in lib and tests)
        run: make lint-strict
