-
Notifications
You must be signed in to change notification settings - Fork 2.4k
92 lines (89 loc) · 2.82 KB
/
test-server.yml
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: Server Test Suite
on:
pull_request:
branches:
- main
paths:
- apps/api/**
# schedule:
# - cron: '0 */4 * * *'
env:
BULL_AUTH_KEY: ${{ secrets.BULL_AUTH_KEY }}
HOST: ${{ secrets.HOST }}
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
PORT: ${{ secrets.PORT }}
REDIS_URL: ${{ secrets.REDIS_URL }}
SCRAPING_BEE_API_KEY: ${{ secrets.SCRAPING_BEE_API_KEY }}
SUPABASE_ANON_TOKEN: ${{ secrets.SUPABASE_ANON_TOKEN }}
SUPABASE_SERVICE_TOKEN: ${{ secrets.SUPABASE_SERVICE_TOKEN }}
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_REPLICA_URL: ${{ secrets.SUPABASE_REPLICA_URL }}
TEST_API_KEY: ${{ secrets.TEST_API_KEY }}
FIRE_ENGINE_BETA_URL: ${{ secrets.FIRE_ENGINE_BETA_URL }}
USE_DB_AUTHENTICATION: true
SERPER_API_KEY: ${{ secrets.SERPER_API_KEY }}
ENV: ${{ secrets.ENV }}
RUNPOD_MU_POD_ID: ${{ secrets.RUNPOD_MU_POD_ID }}
RUNPOD_MU_API_KEY: ${{ secrets.RUNPOD_MU_API_KEY }}
USE_GO_MARKDOWN_PARSER: true
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: Tailscale
uses: tailscale/github-action@v3
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
cache: "pnpm"
cache-dependency-path: './apps/api/pnpm-lock.yaml'
- name: Install dependencies
run: pnpm install
working-directory: ./apps/api
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.19'
cache-dependency-path: ./apps/api/sharedLibs/go-html-to-md/go.sum
- name: Build go-html-to-md
run: |
go mod tidy
go build -o html-to-markdown.so -buildmode=c-shared html-to-markdown.go
chmod +x html-to-markdown.so
working-directory: ./apps/api/sharedLibs/go-html-to-md
- name: Start the application
run: npm start > api.log 2>&1 &
working-directory: ./apps/api
id: start_app
- name: Start worker
run: npm run workers > worker.log 2>&1 &
working-directory: ./apps/api
id: start_workers
- name: Start index worker
run: npm run index-worker &
working-directory: ./apps/api
id: start_index_worker
- name: Wait for API
run: pnpx wait-on tcp:3002 -t 15s
- name: Run snippet tests
run: |
npm run test:snips
working-directory: ./apps/api