name: Simple

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    name: Rust ${{matrix.rust}}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        rust: [1.36.0, 1.41.0, 1.46.0, 1.51.0, stable, beta, nightly]
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: recursive
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{matrix.rust}}
      - run: cargo check
      - run: cargo test
      - run: cargo test --features=compact

  check:
    name: Lint code
    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
    steps:
      - uses: actions/checkout@v2
      - name: Install latest nightly
        uses: actions-rs/toolchain@v1
        with:
            toolchain: nightly
            override: true
            components: rustfmt, clippy
      - run: ci/check.sh
