From 9d60b45cdbc6849fae8bb16ba8d349bceb5ee5a6 Mon Sep 17 00:00:00 2001 From: Mahdi Robatipoor Date: Mon, 12 Feb 2024 17:27:20 +0330 Subject: [PATCH] update doc and deps and workflows --- .env | 1 + .github/workflows/build-checker.yml | 4 +++- .github/workflows/code-linter.yml | 4 +++- .../{code-formater.yml => code-style-checker.yml} | 6 ++++-- .github/workflows/security-checker.yml | 1 + .github/workflows/spell-checker.yml | 7 ++++++- .github/workflows/test.yml | 4 +++- Cargo.toml | 8 ++++---- README.md | 3 ++- run.sh | 2 +- src/entity/role.rs | 2 +- 11 files changed, 29 insertions(+), 13 deletions(-) rename .github/workflows/{code-formater.yml => code-style-checker.yml} (87%) diff --git a/.env b/.env index 49d54a8..1def32b 100644 --- a/.env +++ b/.env @@ -1,4 +1,5 @@ APP_PROFILE=dev RUST_BACKTRACE=1 RUST_LOG=info +# This environment variable is only used for SeaORM command line tools. DATABASE_URL=postgres://username:password@localhost:5432/database_name diff --git a/.github/workflows/build-checker.yml b/.github/workflows/build-checker.yml index ecc1ff4..95760f2 100644 --- a/.github/workflows/build-checker.yml +++ b/.github/workflows/build-checker.yml @@ -1,7 +1,9 @@ name: build checker + on: push: - branches: ["main","dev"] + branches: + - '**' env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/code-linter.yml b/.github/workflows/code-linter.yml index ae9de44..a481349 100644 --- a/.github/workflows/code-linter.yml +++ b/.github/workflows/code-linter.yml @@ -1,7 +1,9 @@ name: code linter + on: push: - branches: ["main","dev"] + branches: + - '**' env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/code-formater.yml b/.github/workflows/code-style-checker.yml similarity index 87% rename from .github/workflows/code-formater.yml rename to .github/workflows/code-style-checker.yml index 5f3ec74..ed4bdf7 100644 --- a/.github/workflows/code-formater.yml +++ b/.github/workflows/code-style-checker.yml @@ -1,7 +1,9 @@ -name: format checker +name: code style checker + on: push: - branches: ["main","dev"] + branches: + - '**' env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/security-checker.yml b/.github/workflows/security-checker.yml index c096dc9..f8d8d03 100644 --- a/.github/workflows/security-checker.yml +++ b/.github/workflows/security-checker.yml @@ -1,4 +1,5 @@ name: security checker + on: push: paths: diff --git a/.github/workflows/spell-checker.yml b/.github/workflows/spell-checker.yml index 533e59a..74e0ed3 100644 --- a/.github/workflows/spell-checker.yml +++ b/.github/workflows/spell-checker.yml @@ -1,5 +1,10 @@ name: spell checker -on: [pull_request] + +on: + push: + branches: + - '**' + env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9cd70ac..8e979bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,9 @@ name: test + on: push: - branches: ["main","dev"] + branches: + - '**' env: CARGO_TERM_COLOR: always diff --git a/Cargo.toml b/Cargo.toml index 1945723..cb0c1ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ chrono = { version = "0.4.31", default-features = false, features = [ "clock", "serde", ] } -config = "0.13.4" +config = "0.14.0" fake = { version = "2.9.2", features = ["derive", "uuid", "chrono"] } futures = "0.3.30" itertools = "0.12.0" @@ -75,6 +75,6 @@ utoipa = { version = "4.2.0", features = ["axum_extras", "uuid", "chrono"] } utoipa-swagger-ui = { version = "6.0.0", features = ["axum"] } uuid = { version = "1.6.1", features = ["v4", "serde"] } tokio-tungstenite = "0.21.0" -wiremock = "0.5.22" -garde = "0.17.0" -regex = "1.10.2" \ No newline at end of file +garde = { version = "0.18.0", features = ["full"] } +regex = "1.10.3" +wiremock = "0.6.0" \ No newline at end of file diff --git a/README.md b/README.md index d40c84a..d792006 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,9 @@ export APP_SERVER__PORT=8080 export APP_SERVER__ADDR=127.0.0.1 ``` #### Switching profiles +Before running the application, export this variable: ```bash -export APP_PROFILE=prod # switch to production profile +export APP_PROFILE=prod # Switch to production profile ``` ### Check code formatting and typo at commit time ``` diff --git a/run.sh b/run.sh index aac8acf..a4efe78 100755 --- a/run.sh +++ b/run.sh @@ -3,5 +3,5 @@ ./scripts/init_redis.sh ./scripts/init_mailhog.sh ./scripts/init_mockserver.sh -export APP_PROFILE=dev +export $(cat .env | xargs) cargo run --bin app diff --git a/src/entity/role.rs b/src/entity/role.rs index f4a6f33..ed91845 100644 --- a/src/entity/role.rs +++ b/src/entity/role.rs @@ -27,4 +27,4 @@ pub enum RoleUser { User, #[sea_orm(string_value = "System")] System, -} +} \ No newline at end of file