# This workflow ONLY calls `just` commands. The justfile is the source of truth.
name: CI (Linux)

on:
  pull_request:
    branches: [main]
  workflow_dispatch:

jobs:
  ci:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: extractions/setup-just@v2

      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: 1.95.0
          components: rustfmt, clippy

      - name: Cache cargo registry
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: |
            ${{ runner.os }}-cargo-

      - run: just ci
