name: Tests

on: [push]

jobs:
  miri:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
      - name: Run miri
        run: ci/miri.sh    
  tests:
    strategy:
      matrix:
        rust:
          - stable
          - beta
          - nightly
        os:
          - ubuntu-latest
          - windows-latest
          - macOS-latest
        rustflags:
          - '-C target-cpu=native'
          - '-C target-cpu=native -C target-feature=-avx2'
        features:
          - ''
          - '--features impl_serde'
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v1
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          override: true
      - name: Run tests
        run: cargo test ${{ matrix.features }}
