name: "Test Suite"
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

permissions: {}

jobs:
  test:
    name: cargo test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          persist-credentials: false

      - uses: actions/cache@v4
        with:
          path: |
            ~/.rustup
            ~/.cargo/registry
            ~/.cargo/git
          key: rust-${{ runner.os }}-${{ hashFiles('mise.toml', '.github/workflows/main.yml') }}
          restore-keys: |
            rust-${{ runner.os }}-

      - uses: jdx/mise-action@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          cache_key: rust-${{ runner.os }}-${{ hashFiles('mise.toml', '.github/workflows/main.yml') }}
      - run: cargo check --all --all-features
      - run: mise check