name: Pr

on:
  pull_request:
  pull_request_target:
  workflow_dispatch:

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

permissions:
  actions: read
  contents: read

jobs:
  Check:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha || github.ref }}

      - name: Setup Tooling
        uses: jdx/mise-action@d6e32c1796099e0f1f3ac741c220a8b7eae9e5dd
        with:
          install: true
          cache: true
          experimental: true

      - name: Run Checks
        run: |
          mise run setup
          mise run lint
          mise run test
          mise run build
