on: push
name: clippy check

# Make sure CI fails on all warnings, including Clippy lints
env:
  RUSTFLAGS: "-D warnings"

permissions:
  actions: read # An explanation.

jobs:
  clippy_check:
    name: clippy check
    runs-on: ubuntu-latest

    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}

    permissions:
      security-events: write # An explanation.
      actions: read # An explanation.

    steps:
      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
        with:
          persist-credentials: false

      - name: Run clippy
        run: |
          sudo apt-get update
          sudo apt-get install libasound2-dev mold
          rustup component add clippy
          cargo clippy --all-targets --examples --features js