-
Notifications
You must be signed in to change notification settings - Fork 328
57 lines (44 loc) · 1.21 KB
/
r2r-js-sdk-integration-tests.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
name: R2R JS SDK Integration Tests
on:
push:
branches:
- '**' # Trigger on all branches
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./js/sdk
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install R2R
run: |
python -m pip install --upgrade pip
pip install r2r
- name: Start R2R server
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
r2r serve --docker
sleep 60
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "20.x"
- name: Install dependencies
run: npm ci
- name: Check if R2R server is running
run: |
curl http://localhost:7272/v2/health || echo "Server not responding"
- name: Display R2R server logs if server not responding
if: failure()
run: docker logs r2r-r2r-1
- name: Run integration tests
run: npm run test
- name: Display R2R server logs if tests fail
if: failure()
run: docker logs r2r-r2r-1