matrix:
  RUST: [stable]

steps:
  lint:
    image: rust
    when:
      - event: manual
      - event: pull_request
      - event: push
    commands:
      - export CARGO_TERM_COLOR=always
      - rustup component add clippy rustfmt
      - cargo clippy --all --tests -- -D warnings
      - cargo fmt --check --all

  build:
    image: rust
    when:
      - event: manual
      - event: pull_request
      - event: push
    commands:
      - export CARGO_TERM_COLOR=always
      - cargo build
      - cargo build --release

  test:
    image: rust
    when:
      - event: manual
      - event: pull_request
      - event: push
    commands:
      - export CARGO_TERM_COLOR=always
      - cargo check
      - cargo test --all
