name: Tests

on:
  pull_request:
  push:
    branches: [ main ]

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

      - uses: dtolnay/rust-toolchain@stable

      - uses: Swatinem/rust-cache@v2

      - name: Build
        run: cargo build --verbose

      - name: Test
        run: cargo test --verbose -- --test-threads=1

      - name: Doc build
        run: cargo doc --no-deps
