name: Rust

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

env:
  CARGO_TERM_COLOR: always

jobs:
  lint:
    runs-on: ubuntu-latest
    
    strategy:
      fail-fast: false
      matrix:
        config:
          # Linux
          - { os: ubuntu-latest, toolchain: stable, target: x86_64-unknown-linux-gnu, cross: false }
          - { os: ubuntu-latest, toolchain: beta, target: x86_64-unknown-linux-gnu, cross: false }
          - { os: ubuntu-latest, toolchain: nightly, target: x86_64-unknown-linux-gnu, cross: false }

    steps:
      - uses: actions/checkout@v2
      - name: Lint code ${{ matrix.config.toolchain }}
        run: cargo fmt --all -- --check

  test:
    needs: lint
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        config:
          # Linux
          - { os: ubuntu-latest, toolchain: stable, target: x86_64-unknown-linux-gnu, cross: false }
          - { os: ubuntu-latest, toolchain: beta, target: x86_64-unknown-linux-gnu, cross: false }
          - { os: ubuntu-latest, toolchain: nightly, target: x86_64-unknown-linux-gnu, cross: false }

    steps:
      - uses: actions/checkout@v2
      - name: Run tests ${{ matrix.config.toolchain }}
        run: cargo test --verbose

name: Rust

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

env:
  CARGO_TERM_COLOR: always

jobs:
  lint:
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        config:
          # Linux
          - { toolchain: stable, target: x86_64-unknown-linux-gnu, cross: false }
          - { toolchain: beta, target: x86_64-unknown-linux-gnu, cross: false }
          - { toolchain: nightly, target: x86_64-unknown-linux-gnu, cross: false }

    steps:
      - uses: actions/checkout@v2
      - name: Lint code ${{ matrix.config.toolchain }}
        run: cargo fmt --all -- --check

  test:
    needs: lint
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        config:
          # Linux
          - { toolchain: stable, target: x86_64-unknown-linux-gnu, cross: false }
          - { toolchain: beta, target: x86_64-unknown-linux-gnu, cross: false }
          - { toolchain: nightly, target: x86_64-unknown-linux-gnu, cross: false }

    steps:
      - uses: actions/checkout@v2
      - name: Run tests ${{ matrix.config.toolchain }}
        run: cargo test --verbose

Remove os from matrix - we only need linux
Remove os from matrix - we only need linux
