Skip to content

Commit 28d8ad8

Browse files
committed
ci: add test.yml
Signed-off-by: Xin Liu <[email protected]>
1 parent f065463 commit 28d8ad8

File tree

1 file changed

+122
-0
lines changed

1 file changed

+122
-0
lines changed

.github/workflows/test.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Test Server
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
test-chat-embeddings:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Clone project
15+
id: checkout
16+
uses: actions/checkout@v5
17+
18+
- name: Install dependencies
19+
run: |
20+
sudo apt-get update && sudo apt-get install -y curl git jq lsof supervisor
21+
22+
- name: Install Hurl
23+
run: |
24+
curl --location --remote-name https://github.com/Orange-OpenSource/hurl/releases/download/5.0.1/hurl_5.0.1_amd64.deb
25+
sudo apt update && sudo apt install ./hurl_5.0.1_amd64.deb
26+
27+
- name: Install GaiaNode
28+
run: |
29+
chmod +x ./install.sh
30+
./install.sh
31+
export PATH=$HOME/gaianet/bin:$PATH
32+
gaianet --help
33+
34+
- name: Initialize GaiaNode
35+
run: |
36+
export PATH=$HOME/gaianet/bin:$PATH
37+
gaianet init
38+
sleep 10
39+
40+
- name: Start GaiaNode
41+
run: |
42+
export PATH=$HOME/gaianet/bin:$PATH
43+
gaianet start
44+
sleep 10
45+
46+
- name: Print logs
47+
if: failure()
48+
run: |
49+
cat $HOME/gaianet/log/gaia-nexus.log
50+
cat $HOME/gaianet/log/chat-server.log
51+
52+
- name: Run chat.hurl
53+
run: |
54+
hurl --test --jobs 1 ./tests/chat.hurl
55+
56+
- name: Run embeddings.hurl
57+
run: |
58+
hurl --test --jobs 1 ./tests/embeddings.hurl
59+
60+
- name: Stop GaiaNode
61+
run: |
62+
/home/runner/gaianet/bin/gaianet stop
63+
64+
test-rag:
65+
runs-on: ubuntu-latest
66+
needs: test-chat-embeddings
67+
68+
steps:
69+
- name: Clone project
70+
id: checkout
71+
uses: actions/checkout@v5
72+
73+
- name: Install dependencies
74+
run: |
75+
sudo apt-get update && sudo apt-get install -y curl git jq lsof supervisor
76+
77+
- name: Install Hurl
78+
run: |
79+
curl --location --remote-name https://github.com/Orange-OpenSource/hurl/releases/download/5.0.1/hurl_5.0.1_amd64.deb
80+
sudo apt update && sudo apt install ./hurl_5.0.1_amd64.deb
81+
82+
- name: Install GaiaNode
83+
run: |
84+
chmod +x ./install.sh
85+
./install.sh
86+
export PATH=$HOME/gaianet/bin:$PATH
87+
gaianet --help
88+
89+
- name: Replace config.json for RAG test
90+
run: |
91+
cp ./tests/test.rag.json $HOME/gaianet/config.json
92+
93+
- name: Initialize GaiaNode
94+
run: |
95+
export PATH=$HOME/gaianet/bin:$PATH
96+
gaianet init
97+
sleep 10
98+
99+
- name: Start GaiaNode
100+
run: |
101+
export PATH=$HOME/gaianet/bin:$PATH
102+
gaianet start
103+
sleep 10
104+
105+
- name: Print logs
106+
if: failure()
107+
run: |
108+
cat $HOME/gaianet/log/gaia-nexus.log
109+
cat $HOME/gaianet/log/chat-server.log
110+
111+
- name: Run rag.hurl
112+
run: |
113+
hurl --test --jobs 1 --max-time 1800s ./tests/rag.hurl
114+
115+
- name: Print logs
116+
if: failure()
117+
run: |
118+
cat $HOME/gaianet/log/chat-server.log
119+
120+
- name: Stop GaiaNode
121+
run: |
122+
/home/runner/gaianet/bin/gaianet stop

0 commit comments

Comments
 (0)