image: "rust:latest"
stages:
  - test
  - deploy

variables:
  CARGO_HOME: "$CI_PROJECT_DIR/.cargo"

cache:
    key: ${CI_JOB_NAME}
    paths:
      - target/
      - .cargo/
    policy: pull-push

test:cargo:
  stage: test
  script:
    - cargo test

pages:
  stage: deploy
  only:
    - master
  script:
    - cargo doc -p inpt
    - rm -rf public
    - mkdir public
    - cp -R target/doc/* public
  artifacts:
    paths:
    - public
