image: "rust:latest"

stages:
  - lint
  - build

before_script:
  - apt update && apt install -y wabt
  - rustup target add wasm32-unknown-unknown
  - rustup component add rustfmt
  - rustup component add clippy

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

build:
  stage: build
  script:
    - cargo build --release
    - make
    - cargo run --release -- --out out.gif
  artifacts:
    paths:
      - out.gif
      - target/rapidriter-cat.wat