name: CI

on: [push, pull_request]

env:
  CARGO_TERM_COLOR: always

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Build
        run: cargo build --verbose

  install-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Run tests
        run: cargo install --path .
      - name: Run tests
        run: cargo test --verbose
      - name: Run tests
        run: cargo test --verbose -F fuzzy

  fmt_lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Formatting
        run: cargo fmt --check
      - name: Linting
        run: cargo clippy --verbose
