name: CI Checks
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
jobs:
  cargo-test-all-features:
    name: cargo test (all features)
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: cargo test
        run: cargo test --workspace --all-features
  cargo-test-no-features:
    name: cargo test (no default features)
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: cargo test
        run: cargo test --workspace --no-default-features
  cargo-fmt:
    name: cargo fmt
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: cargo fmt
        run: cargo fmt -- --check
  cargo-clippy:
    name: cargo clippy
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: cargo clippy
        run: cargo clippy --workspace --all-features
  cargo-doc:
    name: cargo doc
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: cargo doc
        run: cargo doc --workspace --all-features
  wasm-build:
    name: wasm build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Add wasm target
        run: rustup target add wasm32-unknown-unknown
      - name: Build for wasm32
        run: cargo build --target wasm32-unknown-unknown --no-default-features
  wasm-test-no-features:
    name: wasm test (no features)
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Add wasm target
        run: rustup target add wasm32-unknown-unknown
      - name: Compile tests for wasm (no default features)
        run: cargo test --target wasm32-unknown-unknown --no-default-features --no-run
  wasm-test-all-features:
    name: wasm test (all features)
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Add wasm target
        run: rustup target add wasm32-unknown-unknown
      - name: Compile tests for wasm (all features)
        run: cargo test --target wasm32-unknown-unknown --all-features --no-run
