name: Check

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

on:
  push:
    branches: [master, main]
  pull_request:
    branches: [master, main]
  workflow_call:

env:
  PATH: /home/ivan/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

jobs:
  fmt:
    name: Formatting
    runs-on: [self-hosted, Linux]
    steps:
      - uses: actions/checkout@v4
      - run: cargo fmt --check

  clippy:
    name: Clippy
    runs-on: [self-hosted, Linux]
    steps:
      - uses: actions/checkout@v4
      - run: cargo clippy -- -D warnings
