1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-02-22 20:52:27 +00:00

Update CI to use the rust Docker image

This commit is contained in:
msrd0 2020-11-21 14:47:29 +00:00
parent e6721275ae
commit 37aa497e59
8 changed files with 56 additions and 30 deletions

View file

@ -9,34 +9,62 @@ variables:
test-default:
stage: test
image: msrd0/rust:alpine
image: rust:1.42-slim
before_script:
- cargo -V
script:
- cargo test --workspace --doc
- cargo test --workspace --tests
- cargo test --workspace --tests -- --ignored
- cargo test --workspace
cache:
key: cargo-default
key: cargo-1-42-default
paths:
- cargo/
- target/
test-all:
stage: test
image: msrd0/rust:alpine-tarpaulin
image: rust:1.42-slim
before_script:
- apk add --no-cache postgresql-dev
- apt update -y
- apt install -y --no-install-recommends libpq-dev
- cargo -V
script:
- cargo test --workspace --all-features --doc
- cargo test --workspace --tests -- --ignored
- cargo test --workspace --all-features
cache:
key: cargo-1-42-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 --all --all-features --exclude-files 'cargo/*' --exclude-files 'derive/*' --exclude-files 'example/*' --ignore-panics --ignore-tests --out Html -v
artifacts:
paths:
- tarpaulin-report.html
cache:
key: cargo-all
key: cargo-stable-all
paths:
- cargo/
- target/
test-trybuild-ui:
stage: test
image: rust:1.48-slim
before_script:
- apt update -y
- apt install -y --no-install-recommends libpq-dev
- cargo -V
script:
- cargo test --workspace --all-features --tests -- --ignored
cache:
key: cargo-1-48-all
paths:
- cargo/
- target/
@ -50,29 +78,27 @@ readme:
doc:
stage: build
image: msrd0/rust:alpine
image: rust:slim
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
artifacts:
paths:
- target/doc/
cache:
key: cargo-doc
key: cargo-stable-doc
paths:
- cargo/
- target/
only:
- master
pages:
stage: publish
image: busybox
script:
- mv target/doc public
- mv tarpaulin-report.html public/coverage.html
- mv target/doc public
- 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

View file

@ -4,11 +4,11 @@ error: async fn must not take &State as an argument as State is not Sync, consid
9 | async fn read_all(state : &State)
| ^^^^^
error[E0433]: failed to resolve: use of undeclared type or module `_gotham_restful_resource_foo_resource_method_read_all`
error[E0433]: failed to resolve: use of undeclared crate or module `_gotham_restful_resource_foo_resource_method_read_all`
--> $DIR/method_async_state.rs:4:10
|
4 | #[derive(Resource)]
| ^^^^^^^^ use of undeclared type or module `_gotham_restful_resource_foo_resource_method_read_all`
| ^^^^^^^^ use of undeclared crate or module `_gotham_restful_resource_foo_resource_method_read_all`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -6,10 +6,10 @@ error: Missing Resource struct. Example: #[read_all(MyResource)]
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared type or module `_gotham_restful_resource_foo_resource_method_read_all`
error[E0433]: failed to resolve: use of undeclared crate or module `_gotham_restful_resource_foo_resource_method_read_all`
--> $DIR/method_no_resource.rs:3:10
|
3 | #[derive(Resource)]
| ^^^^^^^^ use of undeclared type or module `_gotham_restful_resource_foo_resource_method_read_all`
| ^^^^^^^^ use of undeclared crate or module `_gotham_restful_resource_foo_resource_method_read_all`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -4,10 +4,10 @@ error: Didn't expect self parameter
8 | fn read_all(self)
| ^^^^
error[E0433]: failed to resolve: use of undeclared type or module `_gotham_restful_resource_foo_resource_method_read_all`
error[E0433]: failed to resolve: use of undeclared crate or module `_gotham_restful_resource_foo_resource_method_read_all`
--> $DIR/method_self.rs:3:10
|
3 | #[derive(Resource)]
| ^^^^^^^^ use of undeclared type or module `_gotham_restful_resource_foo_resource_method_read_all`
| ^^^^^^^^ use of undeclared crate or module `_gotham_restful_resource_foo_resource_method_read_all`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -4,10 +4,10 @@ error: Too few arguments
8 | fn read()
| ^^^^
error[E0433]: failed to resolve: use of undeclared type or module `_gotham_restful_resource_foo_resource_method_read`
error[E0433]: failed to resolve: use of undeclared crate or module `_gotham_restful_resource_foo_resource_method_read`
--> $DIR/method_too_few_args.rs:3:10
|
3 | #[derive(Resource)]
| ^^^^^^^^ use of undeclared type or module `_gotham_restful_resource_foo_resource_method_read`
| ^^^^^^^^ use of undeclared crate or module `_gotham_restful_resource_foo_resource_method_read`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -4,10 +4,10 @@ error: Too many arguments
8 | fn read_all(_id : u64)
| ^^^
error[E0433]: failed to resolve: use of undeclared type or module `_gotham_restful_resource_foo_resource_method_read_all`
error[E0433]: failed to resolve: use of undeclared crate or module `_gotham_restful_resource_foo_resource_method_read_all`
--> $DIR/method_too_many_args.rs:3:10
|
3 | #[derive(Resource)]
| ^^^^^^^^ use of undeclared type or module `_gotham_restful_resource_foo_resource_method_read_all`
| ^^^^^^^^ use of undeclared crate or module `_gotham_restful_resource_foo_resource_method_read_all`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -4,10 +4,10 @@ error: Resource methods must not be unsafe
8 | unsafe fn read_all()
| ^^^^^^
error[E0433]: failed to resolve: use of undeclared type or module `_gotham_restful_resource_foo_resource_method_read_all`
error[E0433]: failed to resolve: use of undeclared crate or module `_gotham_restful_resource_foo_resource_method_read_all`
--> $DIR/method_unsafe.rs:3:10
|
3 | #[derive(Resource)]
| ^^^^^^^^ use of undeclared type or module `_gotham_restful_resource_foo_resource_method_read_all`
| ^^^^^^^^ use of undeclared crate or module `_gotham_restful_resource_foo_resource_method_read_all`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -4,11 +4,11 @@ error: Unknown method: `read_any'
4 | #[resource(read_any)]
| ^^^^^^^^
error[E0277]: the trait bound `FooResource: gotham_restful::Resource` is not satisfied
error[E0277]: the trait bound `FooResource: Resource` is not satisfied
--> $DIR/resource_unknown_method.rs:7:1
|
7 | #[read_all(FooResource)]
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `gotham_restful::Resource` is not implemented for `FooResource`
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Resource` is not implemented for `FooResource`
|
= help: see issue #48214
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)