1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-02-23 04:52:28 +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: test-default:
stage: test stage: test
image: msrd0/rust:alpine image: rust:1.42-slim
before_script: before_script:
- cargo -V - cargo -V
script: script:
- cargo test --workspace --doc - cargo test --workspace
- cargo test --workspace --tests
- cargo test --workspace --tests -- --ignored
cache: cache:
key: cargo-default key: cargo-1-42-default
paths: paths:
- cargo/ - cargo/
- target/ - target/
test-all: test-all:
stage: test stage: test
image: msrd0/rust:alpine-tarpaulin image: rust:1.42-slim
before_script: before_script:
- apk add --no-cache postgresql-dev - apt update -y
- apt install -y --no-install-recommends libpq-dev
- cargo -V - cargo -V
script: script:
- cargo test --workspace --all-features --doc - cargo test --workspace --all-features
- cargo test --workspace --tests -- --ignored 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 - 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: artifacts:
paths: paths:
- tarpaulin-report.html - tarpaulin-report.html
cache: 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: paths:
- cargo/ - cargo/
- target/ - target/
@ -50,29 +78,27 @@ readme:
doc: doc:
stage: build stage: build
image: msrd0/rust:alpine image: rust:slim
before_script: before_script:
- cargo -V - cargo -V
script: script:
- cargo doc --all-features - 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: artifacts:
paths: paths:
- target/doc/ - target/doc/
cache: cache:
key: cargo-doc key: cargo-stable-doc
paths: paths:
- cargo/ - cargo/
- target/ - target/
only:
- master
pages: pages:
stage: publish stage: publish
image: busybox image: busybox
script: script:
- mv target/doc public
- mv tarpaulin-report.html public/coverage.html - 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: artifacts:
paths: paths:
- public - 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) 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 --> $DIR/method_async_state.rs:4:10
| |
4 | #[derive(Resource)] 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) = 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) = 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 --> $DIR/method_no_resource.rs:3:10
| |
3 | #[derive(Resource)] 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) = 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) 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 --> $DIR/method_self.rs:3:10
| |
3 | #[derive(Resource)] 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) = 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() 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 --> $DIR/method_too_few_args.rs:3:10
| |
3 | #[derive(Resource)] 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) = 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) 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 --> $DIR/method_too_many_args.rs:3:10
| |
3 | #[derive(Resource)] 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) = 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() 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 --> $DIR/method_unsafe.rs:3:10
| |
3 | #[derive(Resource)] 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) = 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)] 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 --> $DIR/resource_unknown_method.rs:7:1
| |
7 | #[read_all(FooResource)] 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 = help: see issue #48214
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)