name: CI

on:
  pull_request:
    branches:
      - master
  push:
    branches:
      - master

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1
  RUSTFLAGS: -Dwarnings

jobs:
  check-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: "Install minimal stable with clippy"
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          components: clippy

      - name: "Clippy"
        uses: actions-rs/cargo@v1
        with:
          command: clippy
          args: --all-targets

      - name: "Test"
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --tests --benches --examples
