mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-02-22 20:52:27 +00:00
ci: include openapi_type crate
This commit is contained in:
parent
ebea39fe0d
commit
3a3f743369
3 changed files with 30 additions and 4 deletions
|
@ -14,8 +14,7 @@ check-example:
|
||||||
before_script:
|
before_script:
|
||||||
- cargo -V
|
- cargo -V
|
||||||
script:
|
script:
|
||||||
- cd example
|
- cargo check --manifest-path example/Cargo.toml
|
||||||
- cargo check
|
|
||||||
cache:
|
cache:
|
||||||
key: cargo-stable-example
|
key: cargo-stable-example
|
||||||
paths:
|
paths:
|
||||||
|
@ -28,6 +27,7 @@ test-default:
|
||||||
before_script:
|
before_script:
|
||||||
- cargo -V
|
- cargo -V
|
||||||
script:
|
script:
|
||||||
|
- cargo test --manifest-path openapi_type/Cargo.toml -- --skip trybuild
|
||||||
- cargo test
|
- cargo test
|
||||||
cache:
|
cache:
|
||||||
key: cargo-1-49-default
|
key: cargo-1-49-default
|
||||||
|
@ -43,6 +43,7 @@ test-full:
|
||||||
- apt install -y --no-install-recommends libpq-dev
|
- apt install -y --no-install-recommends libpq-dev
|
||||||
- cargo -V
|
- cargo -V
|
||||||
script:
|
script:
|
||||||
|
- cargo test --manifest-path openapi_type/Cargo.toml --all-features -- --skip trybuild
|
||||||
- cargo test --no-default-features --features full
|
- cargo test --no-default-features --features full
|
||||||
cache:
|
cache:
|
||||||
key: cargo-1-49-all
|
key: cargo-1-49-all
|
||||||
|
@ -79,6 +80,7 @@ test-trybuild-ui:
|
||||||
- apt install -y --no-install-recommends libpq-dev
|
- apt install -y --no-install-recommends libpq-dev
|
||||||
- cargo -V
|
- cargo -V
|
||||||
script:
|
script:
|
||||||
|
- cargo test --manifest-path openapi_type/Cargo.toml --all-features -- trybuild
|
||||||
- cargo test --no-default-features --features full --tests -- --ignored
|
- cargo test --no-default-features --features full --tests -- --ignored
|
||||||
cache:
|
cache:
|
||||||
key: cargo-1-50-all
|
key: cargo-1-50-all
|
||||||
|
@ -107,8 +109,9 @@ rustfmt:
|
||||||
- cargo -V
|
- cargo -V
|
||||||
- cargo fmt --version
|
- cargo fmt --version
|
||||||
script:
|
script:
|
||||||
- cargo fmt -- --check
|
- cargo fmt --all -- --check
|
||||||
- ./tests/ui/rustfmt.sh --check
|
- ./tests/ui/rustfmt.sh --check
|
||||||
|
- ./openapi-type/tests/fail/rustfmt.sh --check
|
||||||
|
|
||||||
doc:
|
doc:
|
||||||
stage: build
|
stage: build
|
||||||
|
|
|
@ -16,6 +16,8 @@ error[E0599]: no function or associated item named `schema` found for struct `Fo
|
||||||
= note: the method `schema` exists but the following trait bounds were not satisfied:
|
= note: the method `schema` exists but the following trait bounds were not satisfied:
|
||||||
`Bar: OpenapiType`
|
`Bar: OpenapiType`
|
||||||
which is required by `Foo<Bar>: OpenapiType`
|
which is required by `Foo<Bar>: OpenapiType`
|
||||||
|
`Foo<Bar>: OpenapiType`
|
||||||
|
which is required by `&Foo<Bar>: OpenapiType`
|
||||||
= help: items from traits can only be used if the trait is implemented and in scope
|
= help: items from traits can only be used if the trait is implemented and in scope
|
||||||
= note: the following trait defines an item `schema`, perhaps you need to implement it:
|
= note: the following trait defines an item `schema`, perhaps you need to implement it:
|
||||||
candidate #1: `OpenapiType`
|
candidate #1: `OpenapiType`
|
||||||
|
|
21
openapi_type/tests/fail/rustfmt.sh
Executable file
21
openapi_type/tests/fail/rustfmt.sh
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/busybox ash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
rustfmt=${RUSTFMT:-rustfmt}
|
||||||
|
version="$($rustfmt -V)"
|
||||||
|
case "$version" in
|
||||||
|
*nightly*)
|
||||||
|
# all good, no additional flags required
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# assume we're using some sort of rustup setup
|
||||||
|
rustfmt="$rustfmt +nightly"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return=0
|
||||||
|
find "$(dirname "$0")" -name '*.rs' -type f | while read file; do
|
||||||
|
$rustfmt --config-path "$(dirname "$0")/../../../rustfmt.toml" "$@" "$file" || return=1
|
||||||
|
done
|
||||||
|
|
||||||
|
exit $return
|
Loading…
Add table
Reference in a new issue