name: Tests

on: [push, pull_request]

jobs:
  test-latest:
    name: Test on Latest
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - name: Test
        run: make test

  test-stable:
    name: Test on 1.61.0
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: 1.61.0
      - name: Test
        run: make cargotest

  build-old-stable:
    name: Check on 1.51.0
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: 1.51.0
      - name: Check
        run: cargo check --no-default-features
