name: build

on:
  pull_request:
    branches: [main]

env:
  CARGO_TERM_COLOR: always

jobs:
  static-analysis:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: cachix/install-nix-action@v31.8.3
      - run: nix flake check --print-build-logs

  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macOS-latest, windows-latest]
        architecture: [x64, x86]
        toolchain: [stable]
    needs:
      - static-analysis
    steps:
      - uses: actions/checkout@v5
      - name: Run Tests
        run: cargo test --verbose -- --nocapture

  all-go:
    name: all systems go
    runs-on: ubuntu-latest
    needs:
      - test
    steps:
      - run: exit 0
