From 42c082085cfd7238c7ab87e5bd06b9e52a698a71 Mon Sep 17 00:00:00 2001 From: fx Date: Sat, 21 Oct 2023 21:47:16 +0200 Subject: fixed move of init_db_pool --- .github/workflows/pull_request.yml | 24 +++++++++++++++++++++--- .github/workflows/push.yml | 9 ++------- src/db.rs | 4 ++++ 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 9a1d005..ed01e9e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -12,7 +12,7 @@ env: CARGO_TERM_COLOR: always jobs: - test: + check: runs-on: ubuntu-latest steps: - name: Run sccache-cache @@ -35,7 +35,25 @@ jobs: with: command: clippy - - name: run test + check-release: + runs-on: ubuntu-latest + steps: + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.3 + + - uses: actions/checkout@v4 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: rustfmt, clippy + override: true + + - name: run cargo check + uses: actions-rs/cargo@v1 + with: + command: check --release + + - name: run clippy uses: actions-rs/cargo@v1 with: - command: test + command: clippy --release diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index acffe51..1f48264 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -28,17 +28,12 @@ jobs: - name: Run cargo check uses: actions-rs/cargo@v1 with: - command: check + command: check --release - name: Run Clippy uses: actions-rs/cargo@v1 with: - command: clippy - - - name: run test - uses: actions-rs/cargo@v1 - with: - command: test + command: clippy --release build: runs-on: ubuntu-latest diff --git a/src/db.rs b/src/db.rs index 295780e..3c51e2b 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1,9 +1,13 @@ +#[cfg(debug_assertions)] use std::env; use serde::Serialize; use sqlx::{PgPool, postgres::PgPoolOptions}; use tracing::{debug, info}; +#[cfg(not(debug_assertions))] +use crate::config::SETTINGS; + #[derive(Serialize)] pub struct Device { pub id: String, -- cgit v1.2.3 From 2201ebfafe5a4246184d2aca566ca473ab73402f Mon Sep 17 00:00:00 2001 From: FxQnLr <39925636+FxQnLr@users.noreply.github.com> Date: Sat, 21 Oct 2023 22:00:22 +0200 Subject: Update pull_request.yml --- .github/workflows/pull_request.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ed01e9e..d7eaaf3 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -51,9 +51,11 @@ jobs: - name: run cargo check uses: actions-rs/cargo@v1 with: - command: check --release + command: check + args: --release - name: run clippy uses: actions-rs/cargo@v1 with: - command: clippy --release + command: clippy + args: --release -- cgit v1.2.3 From ed47f77439a74ff58cc05367bd7a9d9fec324d97 Mon Sep 17 00:00:00 2001 From: FxQnLr <39925636+FxQnLr@users.noreply.github.com> Date: Sat, 21 Oct 2023 22:01:06 +0200 Subject: Update push.yml --- .github/workflows/push.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 1f48264..93b6edb 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -28,12 +28,14 @@ jobs: - name: Run cargo check uses: actions-rs/cargo@v1 with: - command: check --release - + command: check + args: --release + - name: Run Clippy uses: actions-rs/cargo@v1 with: - command: clippy --release + command: clippy + args: --release build: runs-on: ubuntu-latest -- cgit v1.2.3