name: Lint

on:
    push:
        branches: ["main"]
    pull_request:
        branches: ["main"]
    workflow_dispatch:

env:
    CARGO_TERM_COLOR: always

jobs:
    clippy:
        name: Clippy
        runs-on: ubuntu-latest
        timeout-minutes: 20

        steps:
            - uses: actions/checkout@v6
            - name: Run clippy
              run: rustup update; cargo clippy --workspace --exclude luminal_cuda_lite --exclude luminal_metal --exclude luminal_bench --all-targets -- -D warnings

    fmt:
        name: Fmt
        runs-on: ubuntu-latest
        timeout-minutes: 20

        steps:
            - uses: actions/checkout@v6
            - name: Format
              run: cargo fmt --all --check
