name: fslock CI - Check
on: [push, pull_request]

jobs:
  check-linux:
    name: Check Linux
    runs-on: ubuntu-latest
    env:
      RUST_BACKTRACE: 1
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

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

      - name: Run cargo check without default features
        uses: actions-rs/cargo@v1
        with:
          command: check
          args: --no-default-features

  check-windows:
    name: Check Windows
    runs-on: windows-latest
    env:
      RUST_BACKTRACE: 1
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

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

      - name: Run cargo check without default features
        uses: actions-rs/cargo@v1
        with:
          command: check
          args: --no-default-features

  check-macos:
    name: Check MacOS
    runs-on: macos-latest
    env:
      RUST_BACKTRACE: 1
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

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

      - name: Run cargo check without default features
        uses: actions-rs/cargo@v1
        with:
          command: check
          args: --no-default-features

  test-linux:
    name: Test Suite on Linux
    runs-on: ubuntu-latest
    env:
      RUST_BACKTRACE: 1
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

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

      - name: Run cargo test without default features
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --no-default-features

  test-windows:
    name: Test Suite on Windows
    runs-on: windows-latest
    env:
      RUST_BACKTRACE: 1
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

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

      - name: Run cargo test without default features
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --no-default-features

  test-macos:
    name: Test Suite on MacOS
    runs-on: macos-latest
    env:
      RUST_BACKTRACE: 1
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

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

      - name: Run cargo test without default features
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --no-default-features
