name: Build + Tests

on:
  push:
    branches: ["main"]
  pull_request:
    branches: ["main"]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [windows-latest, ubuntu-latest, macos-latest]

    steps:
      - uses: actions/checkout@v3
      - name: Set up Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true
      - name: Install Deps On Linux
        if: runner.os == 'Linux'
        run: |
          sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
      - name: Build
        run: cargo build --verbose
      - name: Run tests
        run: cargo test --verbose
