Skip to content

Commit

Permalink
cargo clippy fix and fmt, cicd add dry run
Browse files Browse the repository at this point in the history
  • Loading branch information
4t145 committed Oct 18, 2024
1 parent 69327a3 commit 5984f95
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,31 @@ jobs:
with:
name: code-coverage-report
path: cobertura.xml
publish-macros-dry-run:
needs: [check]
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Init rust envrionment
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Cargo login
run: cargo login ${{ secrets.CRATES_TOKEN }}

- name: Cargo package macros
working-directory: tardis-macros
run: cargo package

- name: Cargo publish macros
working-directory: tardis-macros
run: cargo publish --dry-run
publish-macros:
if: startsWith(github.ref, 'refs/tags/')
needs: [check]
needs: [publish-macros-dry-run]
runs-on: ubuntu-latest
steps:
- name: Check out the repo
Expand Down
2 changes: 1 addition & 1 deletion tardis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ tokio = { version = "1", features = [
] }
tokio-util = { version = "0.7.12" }
# Tardis Macros
tardis-macros = { version = "0.1.0-rc.17", workspace = true, optional = true }
tardis-macros = { version = "0.1.0-rc.17", optional = true }
# Log
tracing = { version = "0.1" }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
Expand Down
4 changes: 2 additions & 2 deletions tardis/src/os/os_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl TardisOSClient {
expiration: None,
};
let default_bucket = if !default_bucket.is_empty() {
Some(*Bucket::new(default_bucket, region.clone(), credentials.clone())?.with_path_style())
Some(Bucket::new(default_bucket, region.clone(), credentials.clone())?.with_path_style())
} else {
None
};
Expand Down Expand Up @@ -374,7 +374,7 @@ impl TardisOSOperations for TardisOSS3Client {
impl TardisOSS3Client {
fn get_bucket(&self, bucket_name: Option<&str>) -> TardisResult<Box<Bucket>> {
if let Some(bucket_name) = bucket_name {
Ok(*Bucket::new(bucket_name, self.region.clone(), self.credentials.clone())?.with_path_style())
Ok(Bucket::new(bucket_name, self.region.clone(), self.credentials.clone())?.with_path_style())
} else {
let bucket =
self.default_bucket.as_ref().ok_or_else(|| TardisError::not_found("[Tardis.OSClient] No default bucket configured", "404-tardis-os-default-bucket-not-exist"))?;
Expand Down
2 changes: 1 addition & 1 deletion tardis/tests/test_config_with_remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use tardis::test::test_container::nacos_server::NacosServer;
use tardis::TardisFuns;

use testcontainers::runners::AsyncRunner;
use testcontainers::{ContainerAsync, GenericImage};
use testcontainers::ContainerAsync;
use testcontainers_modules::rabbitmq::RabbitMq;
use testcontainers_modules::redis::Redis;
use tracing::{info, warn};
Expand Down
2 changes: 1 addition & 1 deletion tardis/tests/test_reldb_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ pub mod entities {
}

fn create_index_statement() -> Vec<IndexCreateStatement> {
vec![Index::create().name(&format!("idx-{}-{}", Entity.table_name(), Column::OwnPaths.to_string())).table(Entity).col(Column::OwnPaths).to_owned()]
vec![Index::create().name(format!("idx-{}-{}", Entity.table_name(), Column::OwnPaths.to_string())).table(Entity).col(Column::OwnPaths).to_owned()]
}
}

Expand Down

0 comments on commit 5984f95

Please sign in to comment.