name: Rust

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

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [macOS-latest, windows-2019, ubuntu-latest]
        include:
          - os: ubuntu-latest
            command: sudo apt-get update && sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev libgtk-3-dev

    steps:
      - uses: actions/checkout@v2
      - run: ${{ matrix.command }}
      - name: Build
        run: cargo build --verbose
      - name: Run tests
        run: cargo test --verbose
