name: Test

on:
  workflow_call:
  push:
    branches: dev
  pull_request:
    branches: dev

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: x86_64-unknown-linux-gnu

      - name: Run tests with all features
        run: cargo test --all-features

      - name: Run library tests
        run: cargo test --lib

      - name: Run function & integration tests
        run: cargo test --test '*'