name: Tests

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        toolchain: ["beta", "1.36.0"]
    steps:
      - uses: actions/checkout@v2
      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ matrix.toolchain }}
          override: true
          components: rustfmt
      - name: Rustfmt check
        uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --all -- --check
      - name: Test
        run: cargo test --all-features
