image: "rust:latest"

stages:
  - test
  - build

before_script:
  - apt-get update -q && apt-get install mingw-w64 -yqq
  - rustup component add rustfmt
  - rustup component add clippy
  - rustup target add x86_64-pc-windows-gnu

test:
  stage: test
  script:
    - cargo fmt -- --check
    - cargo clippy --all-targets --all-features -- -D warnings
    - cargo test

build:
  stage: build
  script:
    - cargo build --release
    - cargo build --release --target x86_64-pc-windows-gnu
  artifacts:
    paths:
      - target/release/dotacat
      - target/x86_64-pc-windows-gnu/release/dotacat.exe

