name: CI

on:
  push

jobs:
  lint:
    strategy:
      matrix:
        include:
          - os: macos-latest
            target: x86_64-apple-darwin
          - os: macos-latest
            target: aarch64-apple-darwin
          - os: ubuntu-latest
            target: x86_64-unknown-linux-gnu
          - os: ubuntu-latest
            target: aarch64-unknown-linux-gnu
          - os: ubuntu-latest
            target: x86_64-unknown-linux-musl
          - os: ubuntu-latest
            target: aarch64-unknown-linux-musl
          - os: windows-latest
            target: x86_64-pc-windows-msvc
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      - name: Setup Rust Toolchain
        uses: actions-rs/toolchain@v1.0.6
        with:
          toolchain: stable
          override: true
          components: clippy

      - name: Run Clippy
        run: cargo clippy --no-deps -- -D clippy::all
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      - name: Setup Rust Toolchain
        uses: actions-rs/toolchain@v1.0.6
        with:
          toolchain: stable
          override: true
          components: clippy
      - uses: taiki-e/install-action@v2
        name: Install cargo-nextest
        with:
          tool: nextest
      - name: Run Nextest
        run: cargo nextest run --target x86_64-unknown-linux-gnu


