diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eb3eb56..771a4a3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 'The documentation is located here' >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 'The documentation is located here' >public/index.html artifacts: paths: - public diff --git a/tests/ui/method_async_state.stderr b/tests/ui/method_async_state.stderr index 4581a45..f66a260 100644 --- a/tests/ui/method_async_state.stderr +++ b/tests/ui/method_async_state.stderr @@ -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) diff --git a/tests/ui/method_no_resource.stderr b/tests/ui/method_no_resource.stderr index d4bc1c4..d5c5521 100644 --- a/tests/ui/method_no_resource.stderr +++ b/tests/ui/method_no_resource.stderr @@ -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) diff --git a/tests/ui/method_self.stderr b/tests/ui/method_self.stderr index d4fea5f..0e4b492 100644 --- a/tests/ui/method_self.stderr +++ b/tests/ui/method_self.stderr @@ -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) diff --git a/tests/ui/method_too_few_args.stderr b/tests/ui/method_too_few_args.stderr index d8daeab..0aed829 100644 --- a/tests/ui/method_too_few_args.stderr +++ b/tests/ui/method_too_few_args.stderr @@ -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) diff --git a/tests/ui/method_too_many_args.stderr b/tests/ui/method_too_many_args.stderr index 3f8bd39..ad8a37b 100644 --- a/tests/ui/method_too_many_args.stderr +++ b/tests/ui/method_too_many_args.stderr @@ -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) diff --git a/tests/ui/method_unsafe.stderr b/tests/ui/method_unsafe.stderr index aeb104e..ad42326 100644 --- a/tests/ui/method_unsafe.stderr +++ b/tests/ui/method_unsafe.stderr @@ -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) diff --git a/tests/ui/resource_unknown_method.stderr b/tests/ui/resource_unknown_method.stderr index 3282dbe..61269c2 100644 --- a/tests/ui/resource_unknown_method.stderr +++ b/tests/ui/resource_unknown_method.stderr @@ -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)