name: Build

on: [push]

jobs:
  build:
    name: Build ${{ matrix.rust }} on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
        rust: [stable, nightly]

    steps:
      - uses: hecrj/setup-rust-action@v1
        with:
          rust-version: ${{ matrix.rust }}
      - uses: actions/checkout@master
      - name: Build
        run: cargo build --verbose
      - name: Run tests
        run: cargo test --verbose -- --test-threads=1
