.test_common: &test_common
  script:
  - rustc --version && cargo --version
  - time cargo test --verbose --jobs 1 --release

test:stable:
  <<: *test_common
  image: "scorpil/rust:stable"

test:beta:
  <<: *test_common
  image: "scorpil/rust:beta"

test:nightly:
  <<: *test_common
  image: "scorpil/rust:nightly"

# caching optimizations at http://blog.wjlr.org.uk/2016/08/16/fast-rust-gitlab-ci.html don't seem relevant as long as have no deps.

pages:
  stage: deploy
  image: "scorpil/rust:stable"
  script:
  - cargo doc
  - mkdir -p public && cp -r target/doc public/doc && cp -r site/* public/
  artifacts:
    paths:
    - public
  only:
  - master
