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
    - cp target/rapidriter-cat.wat .
  artifacts:
    paths:
      - out.gif
      - rapidriter-cat.wat
