Avoid running ci checks twice (#105)
* Avoid running ci checks twice * upgrade rust * move clippy config to cargo.toml
This commit is contained in:
parent
a2ac97db98
commit
7def01a19a
10 changed files with 49 additions and 20 deletions
|
@ -1,54 +1,56 @@
|
||||||
pipeline:
|
variables:
|
||||||
|
- &rust_image "rust:1.77-bullseye"
|
||||||
|
|
||||||
|
steps:
|
||||||
cargo_fmt:
|
cargo_fmt:
|
||||||
image: rustdocker/rust:nightly
|
image: rustdocker/rust:nightly
|
||||||
commands:
|
commands:
|
||||||
- /root/.cargo/bin/cargo fmt -- --check
|
- /root/.cargo/bin/cargo fmt -- --check
|
||||||
|
when:
|
||||||
cargo_check:
|
- event: pull_request
|
||||||
image: rust:1.70-bullseye
|
|
||||||
environment:
|
|
||||||
CARGO_HOME: .cargo
|
|
||||||
commands:
|
|
||||||
- cargo check --all-features --all-targets
|
|
||||||
|
|
||||||
cargo_clippy:
|
cargo_clippy:
|
||||||
image: rust:1.70-bullseye
|
image: *rust_image
|
||||||
environment:
|
environment:
|
||||||
CARGO_HOME: .cargo
|
CARGO_HOME: .cargo
|
||||||
commands:
|
commands:
|
||||||
- rustup component add clippy
|
- rustup component add clippy
|
||||||
- cargo clippy --all-targets --all-features --
|
- cargo clippy --all-targets --all-features
|
||||||
-D warnings -D deprecated -D clippy::perf -D clippy::complexity
|
when:
|
||||||
-D clippy::dbg_macro -D clippy::inefficient_to_string
|
- event: pull_request
|
||||||
-D clippy::items-after-statements -D clippy::implicit_clone
|
|
||||||
-D clippy::wildcard_imports -D clippy::cast_lossless
|
|
||||||
-D clippy::manual_string_new -D clippy::redundant_closure_for_method_calls
|
|
||||||
- cargo clippy --all-features -- -D clippy::unwrap_used
|
|
||||||
|
|
||||||
cargo_test:
|
cargo_test:
|
||||||
image: rust:1.70-bullseye
|
image: *rust_image
|
||||||
environment:
|
environment:
|
||||||
CARGO_HOME: .cargo
|
CARGO_HOME: .cargo
|
||||||
commands:
|
commands:
|
||||||
- cargo test --all-features --no-fail-fast
|
- cargo test --all-features --no-fail-fast
|
||||||
|
when:
|
||||||
|
- event: pull_request
|
||||||
|
|
||||||
cargo_doc:
|
cargo_doc:
|
||||||
image: rust:1.70-bullseye
|
image: *rust_image
|
||||||
environment:
|
environment:
|
||||||
CARGO_HOME: .cargo
|
CARGO_HOME: .cargo
|
||||||
commands:
|
commands:
|
||||||
- cargo doc --all-features
|
- cargo doc --all-features
|
||||||
|
when:
|
||||||
|
- event: pull_request
|
||||||
|
|
||||||
cargo_run_actix_example:
|
cargo_run_actix_example:
|
||||||
image: rust:1.70-bullseye
|
image: *rust_image
|
||||||
environment:
|
environment:
|
||||||
CARGO_HOME: .cargo
|
CARGO_HOME: .cargo
|
||||||
commands:
|
commands:
|
||||||
- cargo run --example local_federation actix-web
|
- cargo run --example local_federation actix-web
|
||||||
|
when:
|
||||||
|
- event: pull_request
|
||||||
|
|
||||||
cargo_run_axum_example:
|
cargo_run_axum_example:
|
||||||
image: rust:1.70-bullseye
|
image: *rust_image
|
||||||
environment:
|
environment:
|
||||||
CARGO_HOME: .cargo
|
CARGO_HOME: .cargo
|
||||||
commands:
|
commands:
|
||||||
- cargo run --example local_federation axum
|
- cargo run --example local_federation axum
|
||||||
|
when:
|
||||||
|
- event: pull_request
|
||||||
|
|
17
Cargo.toml
17
Cargo.toml
|
@ -14,6 +14,23 @@ actix-web = ["dep:actix-web"]
|
||||||
axum = ["dep:axum", "dep:tower", "dep:hyper", "dep:http-body-util"]
|
axum = ["dep:axum", "dep:tower", "dep:hyper", "dep:http-body-util"]
|
||||||
diesel = ["dep:diesel"]
|
diesel = ["dep:diesel"]
|
||||||
|
|
||||||
|
[lints.rust]
|
||||||
|
warnings = "deny"
|
||||||
|
deprecated = "deny"
|
||||||
|
|
||||||
|
[lints.clippy]
|
||||||
|
perf = "deny"
|
||||||
|
complexity = "deny"
|
||||||
|
dbg_macro = "deny"
|
||||||
|
inefficient_to_string = "deny"
|
||||||
|
items-after-statements = "deny"
|
||||||
|
implicit_clone = "deny"
|
||||||
|
wildcard_imports = "deny"
|
||||||
|
cast_lossless = "deny"
|
||||||
|
manual_string_new = "deny"
|
||||||
|
redundant_closure_for_method_calls = "deny"
|
||||||
|
unwrap_used = "deny"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = { version = "0.4.34", features = ["clock"], default-features = false }
|
chrono = { version = "0.4.34", features = ["clock"], default-features = false }
|
||||||
serde = { version = "1.0.197", features = ["derive"] }
|
serde = { version = "1.0.197", features = ["derive"] }
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#![allow(clippy::unwrap_used)]
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
database::Database,
|
database::Database,
|
||||||
http::{http_get_user, http_post_user_inbox, webfinger},
|
http::{http_get_user, http_post_user_inbox, webfinger},
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#![allow(clippy::unwrap_used)]
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
instance::{listen, new_instance, Webserver},
|
instance::{listen, new_instance, Webserver},
|
||||||
objects::post::DbPost,
|
objects::post::DbPost,
|
||||||
|
|
|
@ -416,6 +416,7 @@ async fn retry<T, E: Display + Debug, F: Future<Output = Result<T, E>>, A: FnMut
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[allow(clippy::unwrap_used)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::http_signatures::generate_actor_keypair;
|
use crate::http_signatures::generate_actor_keypair;
|
||||||
|
|
|
@ -224,6 +224,7 @@ pub(crate) fn generate_request_headers(inbox_url: &Url) -> HeaderMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[allow(clippy::unwrap_used)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{config::FederationConfig, http_signatures::generate_actor_keypair};
|
use crate::{config::FederationConfig, http_signatures::generate_actor_keypair};
|
||||||
|
|
|
@ -45,6 +45,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[allow(clippy::unwrap_used)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -339,6 +339,7 @@ const _IMPL_DIESEL_NEW_TYPE_FOR_OBJECT_ID: () = {
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[allow(clippy::unwrap_used)]
|
||||||
pub mod tests {
|
pub mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::traits::tests::DbUser;
|
use crate::traits::tests::DbUser;
|
||||||
|
|
|
@ -245,6 +245,7 @@ pub struct WebfingerLink {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[allow(clippy::unwrap_used)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -275,6 +275,7 @@ pub(crate) fn verify_body_hash(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[allow(clippy::unwrap_used)]
|
||||||
pub mod test {
|
pub mod test {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::activity_sending::generate_request_headers;
|
use crate::activity_sending::generate_request_headers;
|
||||||
|
|
Loading…
Reference in a new issue