mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-02-23 04:52:28 +00:00
the shared runners ofter run out of memory when creating the cache, but are definitely far too slow to be able to work without caching, so try to minimize the amout of storage required.
98 lines
2 KiB
YAML
98 lines
2 KiB
YAML
|
|
stages:
|
|
- test
|
|
- build
|
|
- publish
|
|
|
|
variables:
|
|
CARGO_HOME: $CI_PROJECT_DIR/cargo
|
|
|
|
test-default:
|
|
stage: test
|
|
image: msrd0/rust:alpine
|
|
before_script:
|
|
- cargo -V
|
|
script:
|
|
- cargo test --workspace --tests
|
|
- cargo test --workspace --tests -- --ignored
|
|
after_script:
|
|
- cargo clean
|
|
cache:
|
|
paths:
|
|
- cargo/
|
|
- target/
|
|
|
|
test-all:
|
|
stage: test
|
|
image: msrd0/rust:alpine-tarpaulin
|
|
before_script:
|
|
- apk add --no-cache postgresql-dev
|
|
- cargo -V
|
|
script:
|
|
- cargo test --workspace --all-features --doc
|
|
- cargo test --workspace --tests -- --ignored
|
|
- cargo tarpaulin --target-dir target/tarpaulin --all --all-features --exclude-files 'cargo/*' --exclude-files 'derive/*' --exclude-files 'example/*' --ignore-panics --ignore-tests --out Html -v
|
|
after_script:
|
|
- cargo clean
|
|
artifacts:
|
|
paths:
|
|
- tarpaulin-report.html
|
|
cache:
|
|
paths:
|
|
- cargo/
|
|
- target/
|
|
|
|
readme:
|
|
stage: test
|
|
image: msrd0/cargo-readme
|
|
script:
|
|
- cargo readme -t README.tpl >README.md.new
|
|
- diff README.md README.md.new
|
|
|
|
doc:
|
|
stage: build
|
|
image: msrd0/rust:alpine
|
|
before_script:
|
|
- cargo -V
|
|
script:
|
|
- cargo doc --all-features
|
|
- 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>' >target/doc/index.html
|
|
after_script:
|
|
- cargo clean
|
|
artifacts:
|
|
paths:
|
|
- target/doc/
|
|
cache:
|
|
paths:
|
|
- cargo/
|
|
- target/
|
|
only:
|
|
- master
|
|
|
|
pages:
|
|
stage: publish
|
|
image: busybox
|
|
script:
|
|
- mv target/doc public
|
|
- mv tarpaulin-report.html public/coverage.html
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
only:
|
|
- master
|
|
|
|
publish:
|
|
stage: publish
|
|
image: msrd0/rust:alpine
|
|
before_script:
|
|
- cargo -V
|
|
- cargo login $CRATES_IO_TOKEN
|
|
script:
|
|
- cd gotham_restful_derive
|
|
- cargo publish
|
|
- sleep 1m
|
|
- cd ../gotham_restful
|
|
- cargo publish
|
|
- cd ..
|
|
only:
|
|
- tags
|