image: rust:latest
stages:
- test
- deploy
test:
stage: test
script:
- rustc --version
- cargo --version
- rustup component add rustfmt
- cargo fmt -- --check
- rustup component add clippy
- cargo clippy -- -D warnings
- cargo test
pages:
stage: deploy
only:
- tags@gondolyr/mangadex-api
script:
- cargo doc --verbose --release --document-private-items --all-features
- echo 'Redirecting to mangadex-api documentation...<link rel="prerender" href="mangadex_api/"/><meta http-equiv="refresh" content="3; url=mangadex_api/"/><link rel=prefetch href=rustdoc.css /><link rel=prefetch href=normalize.css /><link rel=prefetch href=rust-logo.png />' >| target/doc/index.html
- cp -r target/doc public
artifacts:
paths:
- public
cache:
key: pages
paths:
- target