Skip to content

chore: initialize monorepo (Rust backend + Next.js frontend) #1

chore: initialize monorepo (Rust backend + Next.js frontend)

chore: initialize monorepo (Rust backend + Next.js frontend) #1

Workflow file for this run

name: Backend CI
on:
push:
branches: [main, develop]
paths:
- "backend/**"
- ".github/workflows/backend-ci.yml"
pull_request:
branches: [main, develop]
paths:
- "backend/**"
- ".github/workflows/backend-ci.yml"
env:
CARGO_TERM_COLOR: always
DATABASE_URL: postgres://postgres:password@localhost:5432/coupang_review_ai
JWT_SECRET: ci-test-secret-key
JWT_EXPIRES_IN: 86400
SERVER_PORT: 8080
defaults:
run:
working-directory: backend
jobs:
test:
name: Check, Lint & Test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: coupang_review_ai
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo registry and build artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: backend
- name: cargo check
run: cargo check --all-targets
- name: cargo fmt --check
run: cargo fmt --check
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
- name: cargo test
run: cargo test --all-targets