Skip to content

feature: Audit Log Service #357

feature: Audit Log Service

feature: Audit Log Service #357

Workflow file for this run

name: Backend CI
on:
push:
branches: ["main", "fix-ci", "master"]
paths:
- "backend/**"
pull_request:
branches: ["main", "fix-ci", "master"]
paths:
- "backend/**"
jobs:
test:
name: Build and Test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: inheritx_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/inheritx_test
MESSAGE_KEY_ENCRYPTION_KEY: test-key-for-ci-only-not-production-use
defaults:
run:
working-directory: backend
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: backend -> target
- name: Install sqlx-cli
run: cargo install sqlx-cli --no-default-features --features postgres
- name: Run migrations
run: sqlx migrate run
- name: Check formatting
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test
- name: Build
run: cargo build --release