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

name: lint

jobs:
  check:
    name: cargo fmt and cargo clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install latest nightly
        uses: actions-rs/toolchain@v1
        with:
            toolchain: nightly
            override: true
            components: rustfmt, clippy

      - name: Run cargo check
        uses: actions-rs/cargo@v1
        with:
          command: check
