mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-02-22 20:52:27 +00:00
143 lines
3.3 KiB
YAML
143 lines
3.3 KiB
YAML
|
|
stages:
|
|
- test
|
|
- build
|
|
- publish
|
|
|
|
variables:
|
|
CARGO_HOME: $CI_PROJECT_DIR/cargo
|
|
RUST_LOG: info,gotham=debug,gotham_restful=trace
|
|
|
|
check-example:
|
|
stage: test
|
|
image: rust:slim
|
|
before_script:
|
|
- cargo -V
|
|
script:
|
|
- cargo check --manifest-path example/Cargo.toml
|
|
cache:
|
|
key: cargo-stable-example
|
|
paths:
|
|
- cargo/
|
|
- target/
|
|
|
|
test-default:
|
|
stage: test
|
|
image: rust:1.49-slim
|
|
before_script:
|
|
- cargo -V
|
|
script:
|
|
- cargo test --manifest-path openapi_type/Cargo.toml -- --skip trybuild
|
|
- cargo test
|
|
cache:
|
|
key: cargo-1-49-default
|
|
paths:
|
|
- cargo/
|
|
- target/
|
|
|
|
test-full:
|
|
stage: test
|
|
image: rust:1.49-slim
|
|
before_script:
|
|
- apt update -y
|
|
- apt install -y --no-install-recommends libpq-dev
|
|
- cargo -V
|
|
script:
|
|
- cargo test --manifest-path openapi_type/Cargo.toml --all-features -- --skip trybuild
|
|
- cargo test --no-default-features --features full
|
|
cache:
|
|
key: cargo-1-49-all
|
|
paths:
|
|
- cargo/
|
|
- target/
|
|
|
|
test-tarpaulin:
|
|
stage: test
|
|
image: rust:slim
|
|
before_script:
|
|
- apt update -y
|
|
- apt install -y --no-install-recommends libpq-dev libssl-dev pkgconf
|
|
- cargo -V
|
|
- cargo install cargo-tarpaulin
|
|
script:
|
|
- cargo tarpaulin --target-dir target/tarpaulin --no-default-features --features full --exclude-files 'cargo/*' --exclude-files 'derive/*' --exclude-files 'example/*' --exclude-files 'target/*' --ignore-panics --ignore-tests --out Html --out Xml -v
|
|
artifacts:
|
|
paths:
|
|
- tarpaulin-report.html
|
|
reports:
|
|
cobertura: cobertura.xml
|
|
cache:
|
|
key: cargo-stable-all
|
|
paths:
|
|
- cargo/
|
|
- target/
|
|
|
|
test-trybuild-ui:
|
|
stage: test
|
|
image: rust:1.50-slim
|
|
before_script:
|
|
- apt update -y
|
|
- apt install -y --no-install-recommends libpq-dev
|
|
- cargo -V
|
|
script:
|
|
- cargo test --manifest-path openapi_type/Cargo.toml --all-features -- trybuild
|
|
- cargo test --no-default-features --features full --tests -- --ignored
|
|
cache:
|
|
key: cargo-1-50-all
|
|
paths:
|
|
- cargo/
|
|
- target/
|
|
|
|
readme:
|
|
stage: test
|
|
image: ghcr.io/msrd0/cargo-readme
|
|
before_script:
|
|
- cargo readme -V
|
|
script:
|
|
- cargo readme -t README.tpl -o README.md.new
|
|
- diff README.md README.md.new
|
|
|
|
rustfmt:
|
|
stage: test
|
|
image:
|
|
name: alpine:3.13
|
|
before_script:
|
|
- apk add rustup
|
|
- rustup-init -qy --default-host x86_64-unknown-linux-musl --default-toolchain none </dev/null
|
|
- source $CARGO_HOME/env
|
|
- rustup toolchain install nightly --profile minimal --component rustfmt
|
|
- cargo -V
|
|
- cargo fmt --version
|
|
script:
|
|
- cargo fmt --all -- --check
|
|
- ./tests/ui/rustfmt.sh --check
|
|
- ./openapi_type/tests/fail/rustfmt.sh --check
|
|
|
|
doc:
|
|
stage: build
|
|
image: rust:slim
|
|
before_script:
|
|
- cargo -V
|
|
script:
|
|
- cargo doc --no-default-features --features full
|
|
artifacts:
|
|
paths:
|
|
- target/doc/
|
|
cache:
|
|
key: cargo-stable-doc
|
|
paths:
|
|
- cargo/
|
|
- target/
|
|
|
|
pages:
|
|
stage: publish
|
|
image: busybox
|
|
script:
|
|
- mv target/doc public
|
|
- mv tarpaulin-report.html public/coverage.html
|
|
- echo '<!DOCTYPE HTML><html><head><meta http-equiv="Refresh" content="0; url=./gotham_restful/index.html"/></head><body>The documentation is located <a href="./gotham_restful/index.html">here</a></body></html>' >public/index.html
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
only:
|
|
- master
|