69 lines
1.9 KiB
YAML
69 lines
1.9 KiB
YAML
name: Backend Actions
|
|
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('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:
|
|
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-build-${{ hashFiles('Cargo.lock') }}
|
|
- name: Build Release Binary
|
|
run: cargo build --release --locked
|
|
|
|
test:
|
|
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-test-${{ hashFiles('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
|
|
run: ./scripts/test.sh
|
|
- name: Upload Test Logs
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: nuchat-${{ hashFiles('src/**') }}-${{ hashFiles('tests/**') }}.log
|
|
path: logs/*
|