-
Notifications
You must be signed in to change notification settings - Fork 6
79 lines (77 loc) · 2.35 KB
/
unit-test.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
---
name: Unit Tests
permissions: read-all
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- '**.py'
- 'requirements.txt'
- 'config.yaml'
- 'test/**.py'
- 'cypress/**/**.ts'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install requirements
run: |
python -m pip install pytest
python -m pip install -r requirements.txt
- name: Download Sources
run: |
python -m pip install -U "huggingface-hub[cli]" hf_transfer
huggingface-cli login --token ${{ secrets.HF_TOKEN }}
huggingface-cli download --repo-type space TotalSundae/dungeons-and-dragons \
--include *.xml \
--local-dir . \
--local-dir-use-symlinks False
env:
HF_HUB_ENABLE_HF_TRANSFER: 1
- name: Basic Unit Test
run: pytest test/test_embed.py -W ignore::DeprecationWarning
cypress:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python Requirements
run: python -m pip install -r requirements.txt
- name: Setup Ollama
run: |
curl https://ollama.ai/install.sh | sh
sleep 5
ollama create volo -f ./Modelfile
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: cypress-io/github-action@v6
with:
config-file: ${{ github.workspace }}/cypress/cypress.config.ts
record: true
spec: cypress/e2e/on_chat_start/spec.cy.ts
start: chainlit run app.py -h
wait-on: 'http://localhost:8000'
wait-on-timeout: 10
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ github.token }}
LANGCHAIN_API_KEY: ${{ secrets.LANGCHAIN_API_KEY }}
- uses: cypress-io/github-action@v6
with:
config-file: ${{ github.workspace }}/cypress/cypress.config.ts
record: true
start: chainlit run app.py -h
wait-on: 'http://localhost:8000'
wait-on-timeout: 10
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ github.token }}
LANGCHAIN_API_KEY: ${{ secrets.LANGCHAIN_API_KEY }}