name: Run tests

on:
  push:
    branches: [main]
    tags: v*
  pull_request:

jobs:
  test:

    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]

    steps:
    - uses: actions/checkout@v1

    - name: Install latest stable toolchain
      uses: actions-rs/toolchain@v1
      with:
        toolchain: stable
        override: true

    - name: "Build"
      uses: actions-rs/cargo@v1
      with:
        command: build
        args: --release

    - name: "Test"
      uses: actions-rs/cargo@v1
      with:
        command: test
        args: --release
