diff --git a/.gitea/workflows/backend.yaml b/.gitea/workflows/backend.yaml index bf88f9e..e1a4951 100644 --- a/.gitea/workflows/backend.yaml +++ b/.gitea/workflows/backend.yaml @@ -3,6 +3,25 @@ run-name: ${{ gitea.actor }} is running backend actions on: [push] jobs: + check: + runs-on: rust-latest + defaults: + run: + working-directory: ./backend + steps: + - uses: actions/checkout@v4 + - name: Load Cache + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-check-${{ hashFiles('backend/Cargo.lock') }} + - name: Run Clippy + run: cargo clippy --no-deps -- -Dwarnings -Dclippy::correctness -Wclippy::pedantic -Wclippy::perf -Aclippy::missing_errors_doc -Aclippy::missing_panics_doc + + build: runs-on: rust-latest defaults: @@ -17,7 +36,7 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-build-${{ hashFiles('Cargo.lock') }} + key: ${{ runner.os }}-cargo-build-${{ hashFiles('backend/Cargo.lock') }} - name: Build Release Binary run: cargo build --release --locked @@ -35,7 +54,9 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-test-${{ hashFiles('Cargo.lock') }} + key: ${{ runner.os }}-cargo-test-${{ hashFiles('backend/Cargo.lock') }} + - name: Build Binary with Shutdown + run: cargo build --features shutdown --bin nuchat - name: Build Test Binary run: cargo test --no-run - name: Run Tests diff --git a/backend/src/main.rs b/backend/src/main.rs index 7f0c844..1c68980 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -45,7 +45,7 @@ async fn main() { } #[allow(clippy::unused_async)] -#[allow(clippy::unused)] +#[allow(unused)] async fn await_shutdown(rx: mpsc::Receiver) -> Result { rx.recv() } diff --git a/backend/src/router.rs b/backend/src/router.rs index 28ae287..df733dc 100644 --- a/backend/src/router.rs +++ b/backend/src/router.rs @@ -5,6 +5,7 @@ use std::time::Duration; use axum::extract::Request; use axum::middleware::{Next, from_fn}; use axum::response::Response; +#[allow(unused_imports)] use axum::routing::{get, post}; use axum::{Router, body::Body}; use http::StatusCode;