name: Unit tests

on: [push, pull_request]
env:
  RUSTFLAGS: "-Dwarnings"

jobs:
  build-and-unit-test:
    name: Test unit-test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Run unit tests
        shell: bash
        run: ./tests/run_unit_tests.sh
  rust-checks:
    runs-on: ubuntu-latest
    name: Cargo Clippy and Format
    steps:
      - uses: actions/checkout@v4
      - name: Rust Formatting
        run: cargo fmt --check
      - name: Run Clippy
        run: cargo clippy --all-targets --all-features
