name: CRDT's CI Testing
on:
  pull_request:
  push:
    branches:
      - master

jobs:
  ci:
    strategy:
      matrix:
        toolchain: [stable, nightly]

    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.toolchain }}
          override: true
          components: clippy, rustfmt, clippy

      - uses: actions-rs/cargo@v1
        with:
          command: test

      - uses: actions-rs/cargo@v1
        with:
          command: test
          args: --examples

      - uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: -- --check

      - uses: actions-rs/cargo@v1
        with:
          command: clippy
