-
Notifications
You must be signed in to change notification settings - Fork 46
120 lines (97 loc) · 2.81 KB
/
tests.yaml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Tests
on:
push:
branches:
- master
pull_request:
schedule:
- cron: "0 0 * * *" # daily
env:
UPSTASH_VECTOR_REST_URL: ${{ secrets.UPSTASH_VECTOR_REST_URL }}
UPSTASH_VECTOR_REST_TOKEN: ${{ secrets.UPSTASH_VECTOR_REST_TOKEN }}
UPSTASH_REDIS_REST_URL: ${{secrets.UPSTASH_REDIS_REST_URL}}
UPSTASH_REDIS_REST_TOKEN: ${{secrets.UPSTASH_REDIS_REST_TOKEN}}
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}}
QSTASH_TOKEN: ${{secrets.QSTASH_TOKEN}}
jobs:
test:
runs-on: ubuntu-latest
concurrency: test
name: Tests
steps:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install Dependencies
run: bun install
- name: Run Lint
run: bun run fmt
- name: Run tests
run: bun run test
- name: Run Build
run: bun run build
cloudflare-workers-local:
needs:
- test
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup nodejs
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install Dependencies
run: bun install
- name: Build
run: bun run build
- name: Install example
run: bun add @upstash/rag-chat@../../dist
working-directory: examples/cloudflare-workers
- name: Add environment
run: |
echo '[vars]' >> wrangler.toml
echo "UPSTASH_VECTOR_REST_URL = \"$UPSTASH_VECTOR_REST_URL\"" >> ./wrangler.toml
echo "UPSTASH_VECTOR_REST_TOKEN = \"$UPSTASH_VECTOR_REST_TOKEN\"" >> ./wrangler.toml
working-directory: examples/cloudflare-workers
- name: Start example
run: bun dev & sleep 10
working-directory: examples/cloudflare-workers
- name: Test
run: bun test ci.test.ts
working-directory: examples/cloudflare-workers
nodejs-local:
needs:
- test
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v3
- name: Setup nodejs
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install Dependencies
run: bun install
- name: Build
run: bun run build
- name: Install example
run: bun add @upstash/rag-chat@../../dist
working-directory: examples/nodejs
- name: Run example
run: npm run dev & sleep 20
working-directory: examples/nodejs
- name: Test
run: bun test ci.test.ts
working-directory: examples/nodejs