62 lines
1.3 KiB
YAML
62 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
ci:
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16
|
|
env:
|
|
POSTGRES_USER: lunarfront
|
|
POSTGRES_PASSWORD: lunarfront
|
|
POSTGRES_DB: lunarfront_test
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 5s
|
|
--health-timeout 3s
|
|
--health-retries 5
|
|
|
|
valkey:
|
|
image: valkey/valkey:8
|
|
options: >-
|
|
--health-cmd "valkey-cli ping"
|
|
--health-interval 5s
|
|
--health-timeout 3s
|
|
--health-retries 5
|
|
|
|
env:
|
|
DATABASE_URL: postgresql://lunarfront:lunarfront@localhost:5432/lunarfront_test
|
|
REDIS_URL: redis://localhost:6379
|
|
JWT_SECRET: ci-secret
|
|
NODE_ENV: test
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Bun
|
|
run: |
|
|
curl -fsSL https://bun.sh/install | bash
|
|
echo "$HOME/.bun/bin" >> $GITHUB_PATH
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Lint
|
|
run: bun run lint
|
|
|
|
- name: Run migrations
|
|
working-directory: packages/backend
|
|
run: bunx drizzle-kit migrate
|
|
|
|
- name: Test
|
|
run: bun run test
|