name: CI

on:
  pull_request:
  push:

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

      - name: Install Rust
        run: rustup toolchain install stable --profile minimal

      - name: Use Rust stable
        run: rustup default stable

      - name: Check formatting
        run: cargo fmt --check

      - name: Run tests
        run: cargo test --locked

      - name: Run examples
        run: |
          cargo run --locked --example hello_activity
          cargo run --locked --example worker_registration

      - name: Build benchmarks
        run: cargo bench --locked --no-run
