-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (78 loc) · 2.3 KB
/
ci.yml
File metadata and controls
92 lines (78 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
lint-and-test:
name: Lint & Test
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:7
ports:
- 27017:27017
options: >-
--health-cmd "mongosh --eval \"db.adminCommand('ping')\""
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Run tests
run: npm run test:run
env:
NODE_ENV: test
MONGO_URI: mongodb://localhost:27017/lexai_test
REDIS_HOST: localhost
REDIS_PORT: 6379
REDIS_PASSWORD: ''
PASETO_LOCAL_SECRET: test-secret-that-is-at-least-32-characters-long
PASETO_ACCESS_EXPIRY: 15m
PASETO_REFRESH_EXPIRY: 7d
PASETO_REFRESH_COOKIE_MAX_AGE_MS: 604800000
RABBITMQ_URL: amqp://guest:guest@localhost:5672
ANALYSIS_QUEUE: lexai.analysis.queue
ALERT_QUEUE: lexai.alert.queue
DLX_EXCHANGE: lexai.dlx
OPENROUTER_API_KEY: test-key
OPENROUTER_BASE_URL: https://openrouter.ai/api/v1
AI_PRIMARY_MODEL: meta-llama/llama-3.1-8b-instruct:free
AI_FALLBACK_MODEL: mistralai/mistral-7b-instruct:free
- name: Upload coverage
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: coverage/
docker-build:
name: Docker Build Check
runs-on: ubuntu-latest
needs: lint-and-test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build API image
run: docker build --target production -f Dockerfile .
- name: Build Worker image
run: docker build --target production -f Dockerfile.worker .