stages:
- build
- deploy
rust-latest:
stage: build
image: rust:latest
cache:
key: latest
paths:
- target
script:
- cargo build --verbose --features chrono
- cargo test --verbose --features chrono
rust-nightly:
stage: build
image: rustlang/rust:nightly
cache:
key: nighty
paths:
- target
script:
- cargo build --verbose --features chrono
- cargo test --verbose --features chrono
allow_failure: true
pages:
stage: deploy
image: rustlang/rust:nightly
cache:
key: pages
paths:
- target
script:
- PATH="$PATH:$(pwd)/target/bin"
- cargo install --root target -v static-compress cargo-tarpaulin oxipng
- "# Finished install, generate docs"
- cargo doc --all --document-private-items --verbose --features chrono
- echo 'Redirecting to serde_mangadex...<link rel="prerender" href="serde_mangadex/"/><meta http-equiv="refresh" content="3; url=serde_mangadex/"/><link rel=prefetch href=rustdoc.css /><link rel=prefetch href=normalize.css /><link rel=prefetch href=rust-logo.png />' > public/index.html
- "# Compressing doc resources"
- COMPRESS='target/doc/**/*.{html,css,js,svg,txt}'
- time static-compress -j 8 -c brotli -q 11 "$COMPRESS"
- time static-compress -j 8 -c gzip -q 9 "$COMPRESS"
- time oxipng -Z $(find target/doc -name '*.png')
- cp -r target/doc public
- "# Checking code coverage"
- cargo-tarpaulin
allow_failure: false
artifacts:
paths:
- public
only:
- master